review-assist-mcp

v1.1.1
io.github.uditk2/review-assist-mcp Checked 7 hours ago Published 22 days ago

Turns an AI coding agent session into a reviewable Intent Document, validated against the diff.

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

get_generation_guide Get the authoring guide

Return the Intent Document JSON Schema and the authoring protocol. Call this first.

compute_diff Open a distillation run

Call this first. Resolves the base/head SHAs, OPENS THE DISTILLATION RUN, and returns the `run_id` every later call needs, the numbered hunk index, and `consent_state` — so you learn whether this repo is opted in BEFORE you spend a document finding out. It does NOT return the diff text: read that with `read_diff`, which pages it. Anchors use these hunk ids and pin to head_sha.

ParameterTypeDescription
base *stringBase ref/branch/SHA, e.g. origin/main
headstringHead ref/SHA (default HEAD)
repostringAbsolute path of the repository to operate on. Required in multi-repo/container setups; defaults to REVIEW_ASSIST_REPO or cwd.

read_diff Read the diff

Read the change itself, a page at a time. `compute_diff` gives you the run handle and the hunk index; the bytes come from here, so no single response can grow with the size of the change. Call it with just the `run_id` to start at H1, then keep passing the `next_cursor` it returns until there is none — that is how you know you have seen the whole diff. To go straight at one thing instead, pass `hunks` or `paths`. Pages break on hunk boundaries, so you never receive half a change; a hunk too large for one page is split by line and labelled with the lines it carries.

ParameterTypeDescription
run_id *stringRun handle from compute_diff. REQUIRED — the run knows the repo and the SHAs.
cursorstringWhere to resume: the `next_cursor` from the previous page ("H14", or "H20:180" inside an oversized hunk). Omit to start at the beginning of the selection.
hunksarrayServe only these hunk ids, e.g. ["H3","H7"]. Use this to substantiate one claim without reading the rest.
max_bytesintegerByte budget for this page's hunk text. Defaults to the server's own ceiling; raise it only if you know your client's cap is higher.
pathsarrayServe only hunks in these files. Ignored when `hunks` is given.

record_hunk_notes Record hunk notes

Reviewer role: write down what a hunk does AS YOU READ IT, one line each. Call this on every page of read_diff, before moving to the next — not at the end. This is the single biggest cost in a distillation: measured over 15 runs, drafting between interview batches took 303, 330, 544, 592 and 916 seconds, and nearly all of it was reconstructing an account of each hunk you had already formed once while paging. Written down, the drafting left is `why`, rationale, assumptions and verification, which genuinely need the whole picture. These become your `tour[].what` bullets, so write them as behav…

ParameterTypeDescription
notes *arrayEvery hunk on the page you just read.
run_id *stringRun handle from compute_diff.

get_hunk_notes Get hunk notes

Reviewer role: your own per-hunk notes, mapped onto the hunk ids of the diff AS IT IS NOW. Call it when you draft the tour: the `what` bullets are already written, so grouping them by the author's plan is what is left. Also call it after head drift. Notes are keyed by hunk content rather than by id, so a commit that renumbers the diff keeps every note and this tells you the new id for each — `moved` lists the ones whose id changed, and `missing` the hunks still unnoted.

ParameterTypeDescription
run_id *stringRun handle from compute_diff.

map_plan_to_hunks Map the plan to hunks

Reviewer role: record which hunks carry each of the author's plan items, and get back the DELTA — the only place batch one has to ask. Call it once you have the author's PLAN answer and your own hunk notes. It returns `unclaimed` (hunks needing coverage that no plan item claims, each with the note you wrote for it) and `unlanded` (plan items no hunk carries). Those two are your batch one, plus the house rules, plus follow-ups where a standing answer came back thin — and nothing else. Where the plan and the change AGREE there is no question: a hunk sitting under the item that predicted it i…

ParameterTypeDescription
items *arrayEvery item of the plan the author gave you. Replaces any previous mapping.
run_id *stringRun handle from compute_diff.

get_reviewer_instructions Get the repository's reviewer instructions

Read this repository's own instructions for the reviewer, from its `.reviewer/` folder. Call it after you have read the diff and BEFORE you record round one: these are the questions this repo always wants asked (invariants a past incident bought, changes that must travel in pairs, churn that is never incidental), and none of it is recoverable from the diff. They are ADDITIONAL questions. They add to your baseline set and to the questions the diff provoked, and replace neither: a short house-rules file does not license a short interview. Most repos have none, and an absent folder is a normal an…

ParameterTypeDescription
filesarrayServe only these files, by path relative to the folder, e.g. ["security.md"]. Omit for all of them.
max_bytesintegerByte budget for the content. Defaults to the server's own ceiling; anything cut comes back in `omitted`.
repostringAbsolute path of the repository. Only needed when you have no run open yet.
run_idstringRun handle from compute_diff. Supply this or `repo`; the run already knows which repository.

list_transcripts List session transcripts

List candidate session transcripts for this repo — across BOTH Claude Code and Codex — ranked so you can pick THIS session's transcript even when several are close in time. Pass `base` (the change's base ref) so ranking scores each candidate by how much it references the changed files and branch. Each candidate includes `first_user`/`last_activity` previews: choose the one whose `first_user` matches how THIS session actually began; prefer higher `relevance`.

ParameterTypeDescription
basestringBase ref/branch/SHA of the change — enables relevance ranking by changed files
headstring
pathstringExplicit transcript path override (skips discovery/ranking)
repostringAbsolute path of the repository. Defaults to REVIEW_ASSIST_REPO or cwd.
run_idstringPass your run_id once you have one, so the reviewer can tell you are working.

import_session Import a session transcript

File a session transcript into this repo's store so list_transcripts and get_spine can find it. Needed when a session leaves nothing on this machine: a Cowork session running in the CLOUD keeps its transcript inside the container it ran in, and the desktop app holds only a composer draft and an evictable cache of a partial event stream. The container writes the file somewhere reachable and calls this. Re-importing OVERWRITES: a live session keeps growing, so a second export must replace the first rather than leave two near-identical candidates for the ranking to choose between.

ParameterTypeDescription
from *stringAbsolute path of the transcript to file (JSONL).
repo *stringAbsolute path of the repository this session belongs to.
session_idstringIdentifier to store it under. Defaults to the source file's name.

get_spine Read a session's conversation

Author role: read a session's WHOLE conversation — every turn you and the agent exchanged, each structured question with the answer chosen, and every command and file edit as one line. This replaces searching. A session is a median 4.8% conversation and 95% tool output; the spine is that 4.8%. Being complete, it removes the one thing retrieval can never rule out — an answer you simply did not find. It is served a page at a time: call it with just the `path`, then keep passing back the `next_cursor` it returns until there is none. That, and nothing else, is how you know you have read the wh…

ParameterTypeDescription
path *stringTranscript path (from list_transcripts)
cursorstringWhere to resume within the selection: the `next_cursor` from the previous page ("87", or "87:4000" inside an oversized turn). Counts SPINE ITEMS. Omit to start at the beginning.
from_entryintegerServe only items at or after this TRANSCRIPT ENTRY index — feed `resume_from` from get_contexts straight in. Needed because `cursor` counts spine ITEMS, not entries, and the two differ by several ti…
max_bytesintegerByte budget for this page. Defaults to the server's own ceiling; raise it only if you know your client's cap is higher.
run_idstringPass your run_id on EVERY page. Reading a long spine is your longest stretch of work and the only way the reviewer can tell you are alive is that you keep calling the server with this run — without…

read_transcript Read part of a transcript

Read a window of the FULL transcript — tool calls, results and all — around an index the spine gave you. This is how a claim gets substantiated: the prose says what was decided, the tool output holds the evidence. Not for hydration; get_spine does that in one call.

ParameterTypeDescription
path *stringTranscript path (from list_transcripts)
limitinteger
offsetinteger
run_idstringPass your run_id so the reviewer can tell you are still working. Without it a long read looks exactly like you having returned.

record_interview_round Record interview questions

Reviewer role: record interview rounds against a RUN — each a question you raised about a thin or under-justified spot. RECORD THE QUESTIONS FIRST, BEFORE you relay them: each comes back with a `q_id`, and the author answers by that id with `answer_questions`, so the server hears the author's own words rather than your account of them. Include the q_ids when you relay. `answer` is optional here and is only for transcribing an answer you already hold — it is marked reviewer-sourced, and does not count as attested. The standing set (the plan, and the questions about the session that do not d…

ParameterTypeDescription
run_id *stringRun handle from compute_diff. REQUIRED — rounds belong to a run, not a directory.
answerstring
questionstring
resolvedboolean
roundsarrayOne or more rounds. Send the whole batch at once.

answer_questions Answer the reviewer's questions

Author role: answer the questions on the run, by `q_id`. This is how your answers reach the document as YOUR words. START WITH THE STANDING SET: those questions are seeded on the run by compute_diff and are answerable from the spine alone, so do NOT wait for the reviewer to ask you anything — it is reading the diff while you read the session, and the two only meet afterwards. An answer the reviewer transcribes on your behalf still works, but is marked reviewer-sourced and does not count as attested — so a document whose interview never happened is visible as such rather than indistinguisha…

ParameterTypeDescription
answers *arrayThe whole batch in one call.
run_id *stringRun handle. Derive it yourself from compute_diff, or take the one the reviewer relayed — they are the same value.

find_sessions_touching Find the session that wrote a change

Author role: find which OTHER session wrote a hunk you cannot explain. Call this BEFORE you answer "the transcript does not cover this" — work begun one day and finished the next leaves the reason in a different session, and that is recoverable. Pass the `run_id` and the hunk ids (`hunks: ["H7"]`); pass `exclude` with the transcript you already read, so the answer is who ELSE wrote it. It runs two steps. STEP 1 narrows to the sessions that touched the hunk's files. STEP 2 matches the hunk's own added lines against each one, and that is the step that answers: `authored` counts lines the sessi…

ParameterTypeDescription
run_id *stringRun handle from compute_diff.
excludearrayTranscript paths you have already read — normally the session you hydrated from.
hunksarrayHunk ids you could not explain, e.g. ["H7"]. Preferred: their added lines are what step 2 matches on.
pathsarrayRepo-relative paths, when you want step 1 only. Step 2 cannot run without hunks to take lines from.

get_contexts Get what a session was about

Author role: what this session was ABOUT, as one labelled context per subject, scored against the change. Call it right after compute_diff and BEFORE get_spine. If `indexed` comes back true the work is already done — a context index is kept per session, so a second distillation of the same session costs nothing. Each context carries a one-sentence `label`, the `blocks` (index ranges) it occupies, `overlap` (files it touched that this diff also changed) and `only_here` (files it touched that the diff did not). `only_here` with no overlap is NOT noise: it is usually an approach tried on this c…

ParameterTypeDescription
path *stringTranscript path, from list_transcripts.
run_id *stringRun handle from compute_diff — the diff's changed paths come from it.

record_contexts Record what a session was about

Author role: record what the session was about, as you read it. A BLOCK is a run of consecutive exchanges — both directions, counter-questions and follow-ups included — about ONE thing; the boundary is a change of subject, never a change of speaker, because "yes, do that" belongs to the exchange it answers. A CONTEXT is a subject and owns one or more blocks: pass an existing `id` to rejoin a subject the session returns to, so A-then-B-then-A stays one context instead of two halves. The `label` is one plain sentence naming the subject AND what happened to it — it is matched against the di…

ParameterTypeDescription
contexts *arrayEvery context this pass saw. Blocks at or after `from` replace what was stored.
from *integerFirst entry this pass read: the `resume_from` get_contexts gave you.
path *stringTranscript path — the same one you passed to get_contexts.
run_id *stringRun handle from compute_diff, for the repository the paths belong to.
scanned_through *integerLast entry this pass read.

read_context Read one part of a session

Author role: the conversation of ONE context, by id — every turn in the blocks it occupies, and nothing else. This is what the index is for: match a question against the labels from get_contexts, then read the two or three contexts that fit, rather than re-reading the whole session for every question. Paged like get_spine: follow `next_cursor` until there is none.

ParameterTypeDescription
context_id *stringA context id from get_contexts, e.g. C3.
path *stringTranscript path.
cursorstring`next_cursor` from the previous page.
max_bytesintegerByte budget for this page.
run_idstringPass your run_id so the reviewer can tell you are still working. Without it a long read looks exactly like you having returned.

get_questions Get the reviewer's questions

Author role: read the questions on the run, with their `q_id`s. This is how you learn what you are being asked — you do NOT need them relayed to you as text, and there is something here to answer BEFORE the reviewer has asked anything: the standing set is seeded at compute_diff, so call this as soon as you have read the spine rather than waiting for a batch. Call it with the `run_id` (derive it yourself from compute_diff, or take the one you were given, they are the same value), answer with `answer_questions` using the ids it returns, then call it again with `only_unanswered: true` to confir…

ParameterTypeDescription
run_id *stringRun handle from compute_diff.
cursorstring`next_cursor` from the previous page. Omit to start at the beginning.
max_bytesintegerByte budget for this page. Defaults to the server's ceiling.
only_unansweredbooleanOnly questions with no answer yet — what is still owed. Use this after a batch to check you covered everything.

get_answers Get the author's answers

Reviewer role: read the author's answers, in the author's own words, straight off the run. This is where the interview reaches you — you do NOT need answers relayed as text, and you must not paraphrase a summary into the document when the verbatim answer is here. Each round carries `answered_by`: only `author` is attested, `reviewer` is your own transcription, and `null` means nobody has answered yet. Paged: follow `next_cursor` until there is none. While questions are still unanswered, a call without a cursor waits on the server for up to 50s and returns as soon as an answer lands, so call…

ParameterTypeDescription
run_id *stringRun handle from compute_diff.
cursorstring`next_cursor` from the previous page. Omit to start at the beginning.
max_bytesintegerByte budget for this page. Defaults to the server's ceiling.
only_answeredbooleanSkip rounds nobody has answered yet. Leave false while you are waiting, so you can see what is still outstanding.

submit_document Validate and write the Intent Document

Validate a candidate Intent Document against the run's diff and head SHA. On pass, write it to .intent/<branch>.json. Takes `run_id` from compute_diff — repo, base and head come from the run, so the interview and the coverage check cannot disagree about which change this is. On failure, returns findings to fix and resubmit.

ParameterTypeDescription
document *The candidate Intent Document — a JSON object, or a JSON string (which is parsed).
run_id *stringRun handle from compute_diff. REQUIRED.
overwritebooleanReplace this branch's existing document even though it describes a DIFFERENT commit range. Refused by default: the usual cause is distilling on a long-lived branch, and the document destroyed is finis…
require_interviewbooleanReject unless at least one reviewer interview round was recorded (enforces the two-agent pass).
strictbooleanFail coverage on any unexplained hunk
writebooleanWrite the document on success

get_role_definitions Get the author and reviewer roles

Return the author and reviewer role definitions for the two-agent distillation, picked for the calling client (Claude Code, Codex, or a generic fallback) and including how to spin them up. Spawn each role in its OWN context: the author holds the transcript and cannot submit; the reviewer submits and never sees the transcript.

ParameterTypeDescription
envstringOverride the environment; default is detected from the MCP client handshake.
installbooleanWrite the definitions where this client reads them (user scope, e.g. ~/.claude/agents). Do this rather than placing the files yourself: the server knows the environment from the handshake, so it write…
rolestringReturn just one role; default returns both.