Skip to main content

MCP reference

The agent-review-mcp binary (equivalently, agent-review serve) starts an MCP server over stdio, built with @modelcontextprotocol/sdk. It registers eight tools: the six review operations plus author self-review and the single follow-up issue operation.

core also exports five expedition operations that remain Pi-only (stabilize, expedite, requestPeerReview, approveDependencyUpgrade, and watchAndReReview). Self-review and follow-up are available here because they are part of the cross-host review handoff contract.

Every tool returns its result the same way: a single text content block holding the same JSON you would get back from the equivalent CLI command, pretty-printed with two-space indentation.

Naming: underscores here, dots in prose​

Tool ids use underscores (review_create), following common MCP naming convention for identifiers. This documentation, and the design notes behind it, refer to the same logical operations with dots (review.create) because that reads better in prose. review_create and review.create name the exact same operation; only the spelling differs by audience.

The eight tools​

Tool idLogical operationPurpose
review_createreview.createAdd the ai-review label plus any skill labels, and request the reviewer(s) natively.
review_listreview.listList open, ai-review-labeled pull requests requested from a login (defaults to yours).
review_claimreview.claimPin the head SHA, post a claim marker, and return the composed review task.
review_self_reviewreview.self-reviewRecord the PR author's successful exact-head Self-review summary.
review_followupreview.followupCreate or return the one meaningful review follow-up issue allowed for the PR.
review_completereview.completeSubmit a PR review at the pinned SHA (which clears the request), then delete the claim marker.
review_enrichreview.enrichPost a consolidated second opinion once the primary review exists; otherwise report waiting or promote.
labels_bootstraplabels.bootstrapIdempotently create or update the ai-review label plus every skill label.

Input fields​

review_create​

FieldTypeRequired
repostringyes
prnumberyes
skillsarray of stringno, defaults to []
reviewersarray of stringno, defaults to the config file's reviewers (see Quick start: Configure); the tool reports an error if both are empty
notestringno

When the authenticated caller is the PR author, review_create refuses the write until review_self_review has recorded a successful pass at the current head. A maintainer requesting a review on somebody else's PR is not gated.

review_list​

FieldTypeRequired
repostringyes
reviewerstringno, defaults to your resolved login

review_claim​

FieldTypeRequired
repostringyes
prnumberyes

review_complete​

FieldTypeRequired
repostringyes
prnumberyes
eventstring enum: approve, request-changes, or commentyes
summarystringyes
commentsarray of { path: string, line: number, body: string }no
reviewedShastringrequired for request-changes; exact claim SHA
modeinitial, rereview, or convergenceno; must match claim history if passed
findingsstructured finding arrayrequired to contain a confirmed blocker for request-changes
workspacestring pathno, defaults to server working directory

review_enrich​

FieldTypeRequired
repostringyes
prnumberyes
verdictstring enum: agree, disagree, or mixedyes
summarystringyes
newFindingsarray of { path: string, line: number, body: string }no
reviewedSha, mode, findings, workspaceexact-head structured fieldsno; same semantics as completion
assessments{ findingId, disposition, rationale }[]required for every structured primary finding

Unlike the other tools, review_enrich makes a single attempt: it does not poll. It reports waiting or promote immediately, and the calling host is responsible for looping (the CLI's enrich command does this for you).

review_self_review​

Takes repo, pr, reviewedSha, whatChanged, howVerified, whyReady, and optional workspace. It posts one author-authenticated current-head comment titled Self-review; dirty, stale, and non-author calls fail.

review_followup​

Takes repo, pr, reviewedSha, title, problem, rationale, acceptanceCriteria, findingIds, and optional workspace. Minimum content and acceptance criteria prevent issue-shaped noise, and the operation creates at most one issue per PR across retries.

labels_bootstrap​

FieldTypeRequired
repostringyes

These are the same shapes documented in full, with worked examples, on the Schemas page; review_create validates against Review Request, review_complete against Review Result.

Host wiring​

Any MCP host can launch the server either through npx, with no local install, or against a globally installed binary.

{ "command": "npx", "args": ["-y", "@input-output-hk/agent-review", "serve"] }
note

Most MCP hosts let you set environment variables per server entry. Use that to pass GITHUB_TOKEN, or AGENT_REVIEW_CONFIG to point the server at a specific config file, without depending on whatever environment the host process itself started with.