codereview-mcp
Provides code review capabilities for GitHub pull requests (including GitHub Enterprise), including defect-oriented reviews, improvement suggestions, and posting review comments.
Provides code review capabilities for GitLab merge requests, including defect-oriented reviews, improvement suggestions, and posting review comments.
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.
codereview-mcp
A stateless MCP server that reviews, rates, and improves pull requests on demand — from any MCP client (Claude Code, Cursor, OMP, ...). Built on Streamable HTTP and deployable as a single container behind Nginx.
Why
Most AI code-review bots hook into webhooks and CI pipelines. codereview-mcp flips the model: the review happens inside your AI client's conversation — you paste an MR/PR link, ask for a review, and get a structured report you can discuss, refine, and post back. The server holds no sessions and stores nothing, so it scales horizontally and leaves no trace.
Related MCP server: code-review-mcp-server
Features
One URL in, one report out — the platform (GitLab / GitHub / GHE) is auto-detected from the URL shape; no per-repo setup.
Structured review — the LLM returns strict JSON (file / line / severity / suggestion); the Markdown report, risk rating, and Critical/High/Medium/Low statistics are rendered by code, never by the model.
Huge-MR protection — generated files (lockfiles, minified bundles, protobuf code) are filtered first; oversized diffs are split into chunks, reviewed concurrently (map-reduce), and merged. Everything filtered/truncated/dropped is stated honestly in the report's coverage notes.
Real-time progress — MCP progress notifications stream every stage (fetch → filter → LLM → merge).
Any OpenAI-compatible LLM — DeepSeek, Claude gateways, private vLLM / Ollama.
Defense-in-depth auth — static bearer token at the Nginx gateway plus an optional independent server-side token check.
Stateless Streamable HTTP — no sticky sessions; safe behind any load balancer.
Tools
Tool | What it does |
| Full defect-oriented review → Markdown report (summary, risk rating, findings sorted by severity, coverage notes). Optional |
| Non-defect improvement suggestions (refactoring, performance, testability, readability, security hardening) → Markdown report. |
| Post any Markdown back to the PR/MR as a comment; returns the comment URL. |
Quick start (local)
git clone https://github.com/lukaisluka/codereview-mcp.git
cd codereview-mcp
uv sync
cp .env.example .env
# edit .env: GitLab/GitHub token, LLM endpoint + key
uv run codereview-mcp # serves http://0.0.0.0:8000/mcpDocker deployment (recommended)
cp .env.example .env # fill in real values, incl. NGINX_AUTH_TOKEN
docker compose up -d --build # nginx gateway on http://<host>:8080The compose stack runs the service (memory-capped at 500 MB) behind an Nginx gateway that enforces the static bearer token and proxies SSE without buffering. Layered timeouts: Nginx 300 s → LLM 240 s → Git API 30 s, so the gateway is always the last to give up.
Point your MCP client at http://<host>:8080/mcp with header
Authorization: Bearer <NGINX_AUTH_TOKEN> — see examples/mcp-clients.md
for Claude Code / Cursor / generic JSON snippets and examples/python_client.py
for a programmatic client with progress callbacks.
Configuration
All settings come from environment variables (or .env). Key ones:
Variable | Default | Description |
|
| Startup hint; actual routing follows the |
| — | GitLab root URL + token (API scope). |
|
| GitHub or GHE; token optional for public repos, required for writes/GHE. |
|
| Model name; a litellm-style |
| — | Any OpenAI-compatible endpoint. Key may be empty for intranet hosts (vLLM/Ollama). |
|
| Per-call LLM timeout (keep ≥ 180 and below the gateway's 300 s). |
|
| Huge-MR protection thresholds. |
|
|
|
| empty | Optional server-side bearer check (defense in depth; |
| — | Static bearer token enforced by the Nginx gateway (compose deployment). |
|
| Language for report prose (summary / descriptions). |
|
| Parallel chunk reviews in map-reduce mode. |
Full list with comments: .env.example
Development
uv sync # install with dev group
uv run pytest # 90+ tests, fully mocked boundaries
uv run ruff check . # lint
uv run ruff format . # formatProject layout:
src/codereview_mcp/
├── config.py # env-driven settings (pydantic-settings)
├── server.py # FastMCP tools, bearer middleware, /health, entrypoint
├── git/ # URL parser, GitLab/GitHub clients, provider factory
└── review/ # diff protection, prompts, LLM client, JSON parsing,
# models, markdown rendering, orchestration serviceLicense
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
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Assess pull requests and read verdicts, findings, evidence and suggested fixes from coding agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables code review operations on GitHub and GitLab, including fetching pull/merge requests, viewing diffs, adding comments, analyzing code quality, and creating merge requests directly from your MCP client.1529 npm4MIT
- AlicenseNot gradedqualityCmaintenanceEnables automated code review and GitHub PR commenting through MCP integration.1,391 npm9MIT
- FlicenseNot gradedqualityDmaintenanceEnables automated AI-powered code review for pull requests across GitHub, GitLab, Bitbucket, and Azure DevOps via webhooks, and manual code review through MCP tools using Groq, Claude, or GPT-4.1-
- FlicenseNot gradedqualityCmaintenanceEnables MCP-connected AI agents to review GitHub pull requests and post meaningful inline review comments directly on them through natural language prompts.-