review-assist-mcp
v1.1.1Turns 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.
| Parameter | Type | Description |
|---|---|---|
base * | string | Base ref/branch/SHA, e.g. origin/main |
head | string | Head ref/SHA (default HEAD) |
repo | string | Absolute 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.
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Run handle from compute_diff. REQUIRED — the run knows the repo and the SHAs. |
cursor | string | Where 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. |
hunks | array | Serve only these hunk ids, e.g. ["H3","H7"]. Use this to substantiate one claim without reading the rest. |
max_bytes | integer | Byte 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. |
paths | array | Serve 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…
| Parameter | Type | Description |
|---|---|---|
notes * | array | Every hunk on the page you just read. |
run_id * | string | Run 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.
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Run 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…
| Parameter | Type | Description |
|---|---|---|
items * | array | Every item of the plan the author gave you. Replaces any previous mapping. |
run_id * | string | Run 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…
| Parameter | Type | Description |
|---|---|---|
files | array | Serve only these files, by path relative to the folder, e.g. ["security.md"]. Omit for all of them. |
max_bytes | integer | Byte budget for the content. Defaults to the server's own ceiling; anything cut comes back in `omitted`. |
repo | string | Absolute path of the repository. Only needed when you have no run open yet. |
run_id | string | Run 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`.
| Parameter | Type | Description |
|---|---|---|
base | string | Base ref/branch/SHA of the change — enables relevance ranking by changed files |
head | string | |
path | string | Explicit transcript path override (skips discovery/ranking) |
repo | string | Absolute path of the repository. Defaults to REVIEW_ASSIST_REPO or cwd. |
run_id | string | Pass 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.
| Parameter | Type | Description |
|---|---|---|
from * | string | Absolute path of the transcript to file (JSONL). |
repo * | string | Absolute path of the repository this session belongs to. |
session_id | string | Identifier 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…
| Parameter | Type | Description |
|---|---|---|
path * | string | Transcript path (from list_transcripts) |
cursor | string | Where 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_entry | integer | Serve 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_bytes | integer | Byte budget for this page. Defaults to the server's own ceiling; raise it only if you know your client's cap is higher. |
run_id | string | Pass 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Transcript path (from list_transcripts) |
limit | integer | |
offset | integer | |
run_id | string | Pass 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…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Run handle from compute_diff. REQUIRED — rounds belong to a run, not a directory. |
answer | string | |
question | string | |
resolved | boolean | |
rounds | array | One 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…
| Parameter | Type | Description |
|---|---|---|
answers * | array | The whole batch in one call. |
run_id * | string | Run 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…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Run handle from compute_diff. |
exclude | array | Transcript paths you have already read — normally the session you hydrated from. |
hunks | array | Hunk ids you could not explain, e.g. ["H7"]. Preferred: their added lines are what step 2 matches on. |
paths | array | Repo-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…
| Parameter | Type | Description |
|---|---|---|
path * | string | Transcript path, from list_transcripts. |
run_id * | string | Run 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…
| Parameter | Type | Description |
|---|---|---|
contexts * | array | Every context this pass saw. Blocks at or after `from` replace what was stored. |
from * | integer | First entry this pass read: the `resume_from` get_contexts gave you. |
path * | string | Transcript path — the same one you passed to get_contexts. |
run_id * | string | Run handle from compute_diff, for the repository the paths belong to. |
scanned_through * | integer | Last 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.
| Parameter | Type | Description |
|---|---|---|
context_id * | string | A context id from get_contexts, e.g. C3. |
path * | string | Transcript path. |
cursor | string | `next_cursor` from the previous page. |
max_bytes | integer | Byte budget for this page. |
run_id | string | Pass 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…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Run handle from compute_diff. |
cursor | string | `next_cursor` from the previous page. Omit to start at the beginning. |
max_bytes | integer | Byte budget for this page. Defaults to the server's ceiling. |
only_unanswered | boolean | Only 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…
| Parameter | Type | Description |
|---|---|---|
run_id * | string | Run handle from compute_diff. |
cursor | string | `next_cursor` from the previous page. Omit to start at the beginning. |
max_bytes | integer | Byte budget for this page. Defaults to the server's ceiling. |
only_answered | boolean | Skip 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.
| Parameter | Type | Description |
|---|---|---|
document * | The candidate Intent Document — a JSON object, or a JSON string (which is parsed). | |
run_id * | string | Run handle from compute_diff. REQUIRED. |
overwrite | boolean | Replace 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_interview | boolean | Reject unless at least one reviewer interview round was recorded (enforces the two-agent pass). |
strict | boolean | Fail coverage on any unexplained hunk |
write | boolean | Write the document on success |
set_consent Record consent for a repository
Record the user's decision about whether Review Assist may operate in a repository: read its coding sessions and write its Intent Document. Call this only after the user has answered the consent prompt (from compute_diff, a session-reading tool, or submit_document). Pass `run_id` whenever you have one: a "once" recorded on the run holds for every agent working on that change, not just this one.
| Parameter | Type | Description |
|---|---|---|
decision * | string | always = enable and remember; once = allow it for this change and this session; never = disable and remember |
repo | string | Absolute repo path, when there is no run. Defaults to REVIEW_ASSIST_REPO or cwd. |
run_id | string | Run handle from compute_diff. Names the repository, and carries a "once" to the other role. |
manage_consent List or reset repository consent
List Review Assist's per-repo enable/disable decisions, or reset one repo — removing it from the list so it is asked about again.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
repo | string | Required for reset: absolute repo path (defaults to current repo). |
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.
| Parameter | Type | Description |
|---|---|---|
env | string | Override the environment; default is detected from the MCP client handshake. |
install | boolean | Write 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… |
role | string | Return just one role; default returns both. |