mcp-agent-review
An MCP server that provides agentic code review powered by OpenAI-compatible models, designed for use with Claude Code.
README
mcp-agent-review
An MCP (Model Context Protocol) server that provides agentic code review powered by OpenAI-compatible models. Designed for use with Claude Code.
Features
- Deep analysis — focuses on logic errors, architecture issues, doc-code consistency, and security risks (not style/lint)
- Agentic review — the model can read files, grep code, check git blame, explore project structure, and search git history to verify findings
- False-positive suppression — mandatory tool verification, confidence rating, and self-critique phase
- Intent-aware review — pass
task_descriptionto catch mismatches between intent and implementation - Directed focus — pass
review_focusto get deeper analysis on a specific dimension (security, performance, concurrency, etc.) - Any OpenAI-compatible API — works with GitHub Models (free), OpenAI, Azure OpenAI, or any compatible provider
- Zero config for git repos — auto-detects diffs, reads CLAUDE.md for project context
- Sensitive file protection — blocks access to
.env,*.pem,*.key, credentials, and other sensitive files
Installation
# From PyPI
pip install mcp-agent-review
# From source
git clone https://github.com/lzx1413/mcp-agent-review
cd mcp_agent_review
pip install .
Claude Code Integration
Add to your Claude Code settings (~/.claude.json or .claude/settings.json):
GitHub Models (free)
{
"mcpServers": {
"code-review": {
"command": "mcp-agent-review",
"env": {
"GITHUB_TOKEN": "your-github-token"
}
}
}
}
OpenAI (or other providers)
{
"mcpServers": {
"code-review": {
"command": "mcp-agent-review",
"env": {
"OPENAI_API_KEY": "your-api-key",
"OPENAI_BASE_URL": "https://api.openai.com/v1",
"REVIEW_MODEL": "gpt-4o"
}
}
}
}
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
GITHUB_TOKEN |
Yes* | — | GitHub personal access token (free via GitHub Models) |
OPENAI_API_KEY |
Yes* | — | API key for OpenAI or compatible provider (takes priority over GITHUB_TOKEN) |
OPENAI_BASE_URL |
No | https://models.github.ai/inference |
Base URL for the API |
REVIEW_MODEL |
No | gpt-4o |
Model to use for review |
MAX_TOOL_ROUNDS |
No | 8 |
Max agentic tool-use rounds |
MAX_FILE_LINES |
No | 1000 |
Max lines to read per file |
*One of GITHUB_TOKEN or OPENAI_API_KEY is required.
Tool Parameters
| Parameter | Required | Description |
|---|---|---|
diff |
No | Custom diff string. If omitted, auto-reads from git diff |
base |
No | Base branch/commit for PR review (e.g. main) |
task_description |
No | What the changes are intended to accomplish (e.g. fix race condition in pool). Enables intent-vs-implementation mismatch detection |
review_focus |
No | Specific dimension to prioritize (e.g. security, performance, concurrency safety). Deeper analysis on this area |
Usage
Once configured in Claude Code, the review_code tool is available:
- Auto-detect changes: just call
review_codewith no arguments — it readsgit diff - PR review: pass
base='main'to review all changes since diverging from main - Custom diff: pass a diff string directly via the
diffparameter - Intent-aware review: pass
task_descriptionto describe what the changes are for — helps catch gaps between intent and implementation - Directed focus: pass
review_focus(e.g.'security','performance') to get deeper analysis on a specific dimension
Example prompts in Claude Code
Review my current changes
Review the changes on this branch against main
Review my changes, the task is to fix the race condition in the connection pool, focus on concurrency safety
How It Works
- Context collection — reads CLAUDE.md, git log, commit messages, and full source of changed files
- Agentic review — sends context + diff to the model, which can use tools (read_file, grep_code, git_blame, list_files, search_git_history, find_test_files) to investigate
- Self-critique — a second pass filters out low-confidence or speculative findings
- Structured output — returns findings with confidence level, category, file location, and explanation
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.