mcp-multi-agent-code-review
Reviews GitHub pull requests through the GitHub REST API: downloads the PR diff, runs the guarded multi-agent review, and can optionally post a summary comment with the verdict and findings. Supports token-based authentication, validates repository and PR inputs, and enforces size limits.
Supports OpenAI as an LLM provider for the review agents, configured via CODEREVIEW_LLM_PROVIDER and OPENAI_API_KEY.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Multi-Agent Code Review MCP Server
An MCP (Model Context Protocol) server that reviews a git diff with three specialised LLM agents and returns one verdict. Point any MCP host (Claude Code, Claude Desktop, Cursor) at it, hand it a diff, and a LangGraph graph does the rest.

How it works
validate -> rate limit -> audit log (deterministic, before any model call)
|
prepare (redact secrets before any model sees the diff)
|
+-----------------+-----------------+
v v v
security quality logic (3 reviewers, run in parallel)
+-----------------+-----------------+
v
supervisor (add secret scan, merge duplicates, apply gate)
|
v
pass | fail | incompleteLangGraph runs the three reviewers as parallel branches over one shared state, and the supervisor waits for all of them.
Each reviewer returns structured output (a Pydantic
AgentReport), so malformed model output is rejected at the boundary.The supervisor adds the results of a deterministic secret scan, collapses the same issue reported by two agents, and applies a severity gate.
Related MCP server: mcp-codexreview
Three verdicts, on purpose
Verdict | Meaning |
| All three reviewers ran and nothing reached the severity gate. |
| At least one finding is at or above the gate (default |
| No blocking finding, but a reviewer could not run (bad key, retired model, rate limit, unparseable answer). |
An earlier version swallowed reviewer errors and returned pass with zero findings. A review gate that fails open is dangerous, because a broken model then looks like clean code. Now a failing reviewer is recorded in agent_errors and the verdict becomes incomplete. Set CODEREVIEW_FAIL_CLOSED=false if you really want the old behaviour.
Guardrails
Input validation: size limit, file-count limit, empty or non-string input.
Secret pre-scan and redaction: AWS keys, private keys, bearer and Slack tokens and key assignments are detected by regex. They are replaced by
[REDACTED-SECRET]before the diff goes to any model, and they fail the review even when every model is down.Rate limiting: a sliding window over 60 seconds. It is one shared limit, not per caller.
Audit log: every call is logged with a SHA-256 of the diff and its size, never the source code.
Untrusted input: each reviewer is told that the diff is data and that instructions inside it must be ignored. This reduces prompt injection through code comments, but it does not remove it (see limits).
Setup
python3.11 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # add GROQ_API_KEY (free at console.groq.com)Run the tests (no key needed):
pytestWatch the whole graph work on a deliberately flawed diff (needs a key):
python scripts/live_demo.pyRegister the server with Claude Code, then call the review_diff tool with a unified diff:
claude mcp add code-review -- python -m src.serverReview a GitHub pull request
review_pull_request(repo, pr_number, post_comment=false) downloads the pull request through the GitHub REST API, runs the same guarded review and returns the verdict. Put a token with read access in .env as GITHUB_TOKEN (public repositories also work without one, with a lower rate limit).
review_pull_request("owner/name", 42) # read only, nothing is written
review_pull_request("owner/name", 42, post_comment=True) # also adds one summary commentRepository and number are validated before a request is built, so nothing can steer the call to another path.
The token goes only into the
Authorizationheader and never into a result, an error or the audit log.The download is cut off at the size limit while streaming.
Writing to GitHub is opt-in per call. Without a token the request is refused before any model call is paid for.
The comment holds the verdict, counts and finding titles with file and line, never source code.
Configuration
Environment variables with the prefix CODEREVIEW_ (or a .env file):
Variable | Default | |
|
|
|
|
| A model id of the chosen provider. Provider model lists change, so check them when you get a "model not found" error. For another provider set this too. |
|
| Gate: |
|
|
|
|
| Larger diffs are rejected. |
|
| Reviews per minute, shared. |
The API key itself uses the provider's usual variable (GROQ_API_KEY, ANTHROPIC_API_KEY or OPENAI_API_KEY).
Tests
61 tests, no network and no key. The model is replaced by a fake that answers for each reviewer, so the tests run the real graph:
the verdict logic, the gate and the duplicate merging
a failing reviewer gives
incomplete, neverpass, and a real finding still wins over an outagea leaked secret fails the review even when all three models are down
secrets never reach the model, and every reviewer is told the diff is untrusted
validation, rate limiting and the audit log (hash only, no source)
the GitHub integration against a mocked API: bad repo names, error codes, token never leaked, size cut-off, nothing written by default, one comment when asked
CI runs them on every push (.github/workflows/tests.yml).
Known limits
Prompt injection is reduced, not solved. A diff can still try to talk a reviewer into silence. Treat the result as help for a human reviewer, not as a replacement for one.
The secret scan knows a few common formats. A secret in an unusual format reaches the model.
The rate limit is in memory and shared. It does not survive a restart and does not separate users.
The reviewers see only the diff, not the rest of the repository.
Pull request review is pull-based (a tool call). There is no webhook receiver yet, so it does not run by itself when a pull request opens.
Model quality decides what is found. The tests prove the plumbing, not the quality of the reviews.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Security reviews for coding agents: diffs checked against your org policy and live infrastructure.
Multi-model code review: a panel of models + detectors return a pass/fail verdict. Paid via x402.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables multi-agent code review with P0/P1/P2 severity scoring by orchestrating locally installed AI CLIs (Claude, Codex) to perform parallel analysis, deterministic scoring, and consensus-building on git diffs.2MIT
- AlicenseAqualityDmaintenanceProvides MCP tools to review git changes using OpenAI Codex CLI, enabling code review of unstaged, staged, or last-commit changes.316 npmMIT
- AlicenseAqualityBmaintenanceEnables an MCP-capable assistant to review GitLab merge requests, GitHub pull requests, and pre-push local branches against ticket requirements, domain rubrics, compiler/lint pre-passes, blast-radius analysis, and SonarQube findings, and to draft inline comments or follow-up tasks in the user's chosen language. Nothing reaches a remote host until a human approves the exact content in an interactive terminal.3MIT
- AlicenseAqualityBmaintenanceEnables code-review gating by converting a git diff into a typed verdict with safety probabilities, severity, and recommended actions for auto-merge or human review.11MIT