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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。