gotchea-mcp

v0.2.0
gotchea-mcp Checked 3 days ago Published 1 month ago

MCP server for gotchea: codebase comprehension maps and quizzes for coding agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

scan Scan repository

Chunk the repository and update the map: detects added, changed, moved and removed chunks. Runs synchronously and may take a while on large repos.

get_map Comprehension map

The comprehension heat map: repo > module > file > symbol, with colour (⬜ unseen, 🟥, 🟨, 🟩), LOC and question counts. Optionally filtered by path and limited in depth.

ParameterTypeDescription
depthintegerLevels below the (filtered) root to include; unlimited when omitted
pathstringOnly this directory, file or chunk id, relative to the repo root

get_chunk_for_file Chunk for file

Find the chunk covering a file position. With `line`: the innermost chunk containing it. Without: the file chunk followed by its leaf chunks. Served from an in-memory index.

ParameterTypeDescription
path *stringFile path relative to the repo root
lineinteger1-based line; the innermost chunk containing it is returned

get_status Comprehension status

Tracked chunk count, question count, reviews due now and the colour distribution of the leaf chunks.

get_generation_tasks Question generation tasks

The next chunks that need quiz questions, highest priority first (no questions yet, most imported, largest gap). Each task has chunk-relative numbered code, import signatures, the stems of existing questions and the instructions. Write the questions yourself, then call save_questions. Best done in a subagent or a separate session, so the answers you write stay out of the context you are quizzed in.

ParameterTypeDescription
langstringQuestion language code such as en, tr or pt-BR; defaults to config questions.lang
limitintegerMost tasks to return (1-10, default 3)

save_questions Save generated questions

Save questions you wrote for one task from get_generation_tasks. Pass the task chunkId and chunkHash unchanged. If the chunk is unknown or its code changed (hash mismatch), the whole call is refused and nothing is saved. Otherwise each question is validated and saved, and rejected ones come back as { index, reason, detail }. Fix those and resubmit only them.

ParameterTypeDescription
chunkHash *stringchunkHash of the generation task; a mismatch means the code changed and the whole call is refused
chunkId *stringchunkId of the generation task
questions *arrayRaw questions: { type, stem, options: [4 strings], correctIndex: 0-3, explanation (cites L<n>), refs: [{start, end}], difficulty: 1-3 }. Line numbers are chunk-relative, as in the task code.
langstringQuestion language code such as en, tr or pt-BR; defaults to config questions.lang

start_quiz Start a quiz

Start a comprehension quiz on one chunk of this repository. Pass `path` (a directory, file or symbol: the chunk that most needs review under it is picked) or `chunkId`; with neither, the whole repo is considered. Optional `count` shortens the quiz (default: the chunk's size, 3–7). Returns the first multiple-choice question with the code it is about, between verbatim relay markers. Show the user everything between the markers verbatim, exactly as written: the code block with its header, the question and all four options in full. Do not shorten, paraphrase or drop any of it. Ask the question t…

ParameterTypeDescription
chunkIdstringExact leaf chunk id (aliases accepted)
countintegerQuestions in this quiz; clamped to [quiz.minQuestions, the chunk size]
includeCodebooleanAttach the chunk's source to each question (default: the config value quiz.showCode, true unless set; a resumed session keeps its own). The preview is the working-tree source, so the quiz is open book…
langstringQuestion language code such as en, tr or pt-BR; defaults to config questions.lang
pathstringDirectory, file or chunk-id prefix, relative to the repo root

submit_answer Submit a quiz answer

Submit the user's answer to the current quiz question. `displayIndex` is the position of the option the user picked, as shown by `start_quiz` or the previous `submit_answer` (A=0, B=1, C=2, D=3). Answers are final and must be given in order. Returns an answer-feedback block (whether it was correct, the correct option, the explanation and the cited code), then the next question with its code, each between verbatim relay markers. Show the answer-feedback block verbatim too. Show the user everything between the markers verbatim, exactly as written: the code block with its header, the question and…

ParameterTypeDescription
displayIndex *integerPosition of the option the user picked, as displayed: A=0, B=1, C=2, D=3
questionId *stringquestionId of the question being answered
sessionId *stringSession id from start_quiz
includeCodebooleanAttach the chunk's source to the next question (default: the session's value, set by start_quiz from includeCode or quiz.showCode, default true). The preview is the working-tree source, so the quiz is…