Tools
review_diff — run the full review pipeline on a diff
review_diff — run the full review pipeline on a diff
Runs the same multi-agent pipeline that reviews a pull request, on a diff you supply.Passing
Reviews run through
review_diff are marked agent-authored, which flips them into the stricter review mode described in agentReview. That is deliberate: a diff arriving from a coding agent gets the scrutiny an agent-authored PR gets.repo is worth it whenever the repository has conventions checked in — without it the review falls back to generic best practices and will flag patterns your team has deliberately chosen.get_review_status — read the latest review for a PR
get_review_status — read the latest review for a PR
Returns the most recent review record for a pull request.
Use it to let an agent poll for a review it triggered, or to pull findings into an editor session without leaving it.
Resources
Serves the repository’s resolved conventions markdown — the same file the review agents receive, resolved through the discovery order (
conventions: in .mergewatch.yml, then AGENTS.md, CONVENTIONS.md, .mergewatch/conventions.md).
This lets a coding agent read your house rules before writing code, rather than finding out about them in review.
Authentication
Every request needs a MergeWatch API key as a Bearer token:Scopes
A key is scoped either to all repositories in the installation, or to an explicit list ofowner/repo strings. A scoped key calling review_diff with a repo outside its list is rejected.
Scope keys to the narrowest set that works. A key that only ever reviews one service does not need access to the rest of the installation.
Transport
HTTP (SaaS)
A Lambda Function URL speaking JSON-RPC 2.0 over HTTPS. This is what managed SaaS users connect to. CORS is deliberately open because MCP clients run locally, on origins MergeWatch cannot enumerate.
stdio (self-hosted)
The
@mergewatch/mcp package also runs as a local stdio server, for self-hosted deployments and for clients that prefer a subprocess to a network endpoint.Session billing
Coding agents iterate. A single change might be reviewed five times as the agent fixes what the previous pass found — and charging full price for each pass would make the tool too expensive to use the way it is meant to be used. Passing a stablesessionId across those calls collapses them into one session:
- A session covers a 30-minute window.
- Within it, each call is billed only the positive delta above the highest cost billed so far.
- Repeated reviews of the same diff therefore cost close to nothing after the first.
sessionId per logical task — not per call, and not one global ID forever. A UUID generated when the agent picks up a task is the right shape.
Error codes
The server returns standard JSON-RPC 2.0 errors, plus two MergeWatch-specific codes:Next steps
API keys
Create and scope the keys this server authenticates with.
Repository conventions
What the conventions resource serves, and how it is resolved.