Multi-Server FastMCP PR Reviewer
多服务器 FastMCP PR 审查器
零成本、多服务器的模型上下文协议(MCP)套件,包含统一网关和基于 LangGraph 的自动化 PR 审查代理。所使用的每个工具/API 均可免费使用(GitHub PAT、Groq LLM)。
架构
Claude Desktop / Agent
|
v
FastMCP Gateway (namespaces: code., gh., doc. — dot-separated per MCP tool-naming spec)
/ | \
v v v
Code GitHub Documentation
Intel Server Server (Groq)
(AST+Radon)(PyGithub)
\ | /
Shared Security & Audit Layer
(API key auth, SQLite WAL, rate limiting)Related MCP server: orchestrator-mcp
项目布局
mcp-pr-reviewer/
├── core/
│ └── security.py # auth + rate limit + SQLite audit decorator
├── servers/
│ ├── code_server.py # AST/radon static analysis (no external API)
│ ├── github_server.py # PyGithub-backed PR/issue/commit tools
│ └── doc_server.py # Groq-backed docstring/README/API doc generation
├── gateway/
│ └── gateway.py # unifies all three servers under code:/gh:/doc: namespaces
├── agent/
│ └── workflow.py # LangGraph PR-review pipeline (fetch → analyze → doc → publish)
├── data/ # SQLite audit_log.db lives here (gitignored)
├── docker-compose.yml
├── Dockerfile
├── requirements.txt
├── .env.example
└── claude_desktop_config.example.json设置
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# edit .env with your real MCP_API_KEY, GITHUB_TOKEN, GROQ_API_KEY在本地运行任何内容之前,加载环境变量,例如:
export $(grep -v '^#' .env | xargs) # macOS/Linux运行
独立服务器(stdio,用于本地测试)
python servers/code_server.py
python servers/github_server.py
python servers/doc_server.py网关
fastmcp run gateway/gateway.py:gatewayDocker
docker compose up --buildClaude Desktop 集成
将 claude_desktop_config.example.json 复制到您的 Claude Desktop 配置(claude_desktop_config.json)中,修复 gateway/gateway.py 的绝对路径,并填写真实的凭据。重新启动 Claude Desktop 以生效。
测试清单
1. 模式验证
fastmcp inspect servers/code_server.py
fastmcp inspect servers/github_server.py
fastmcp inspect servers/doc_server.py2. 安全/审计验证
# Should raise 401 Unauthorized
CLIENT_API_KEY=wrong_key python -c "from servers.code_server import analyse_code; analyse_code('x = 1')"
# Inspect the WAL SQLite audit log
sqlite3 data/audit_log.db "SELECT * FROM access_log ORDER BY id DESC LIMIT 5;"3. 端到端 PR 审查
python -c "
import asyncio
from agent.workflow import app
async def run():
result = await app.ainvoke({
'repo': 'your-username/your-repo',
'pr_number': 1
})
print('Review published:', result['issue_url'])
asyncio.run(run())
"在生产环境中依赖此项目前需要再次确认的注意事项
core/security.py中的bucket是单个进程范围内的TokenBucket——同一服务器上的每个工具共享同一个 60/分钟 的配额。如果需要更细粒度的限制,请拆分为每个工具或每个客户端的桶。secure_tool会引发 FastAPI 的HTTPException,只有当您运行的 FastMCP 传输实际位于 FastAPI/ASGI 之后时,它才能干净地映射到 HTTP 状态码。如果您通过普通 stdio 运行服务器,请在 MCP 层捕获此异常,或将其替换为适合传输的异常。在任何非本地部署之前,将
MCP_API_KEY、GITHUB_TOKEN和GROQ_API_KEY从.env中轮换到真正的密钥管理器——.env仅适用于开发环境。GitHub 的代码搜索 API 的速率限制比核心 API 低得多(30 请求/分钟 vs 5,000 请求/小时)——
search_repo_code在高负载下会首先达到该上限。
This server cannot be deployed
Maintenance
Related MCP Connectors
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP server that exposes GitHub operations as tools for AI agents, enabling code search, issue management, and PR review.12MIT
- FlicenseNot gradedqualityDmaintenanceMulti-model agent orchestration MCP server that enables plan-code-review-deliver pipelines with configurable providers and models.-

ThinkReview MCPofficial
AlicenseNot gradedqualityBmaintenanceHosted MCP server that enables AI code reviews on GitHub, GitLab, Azure DevOps, and Bitbucket PR/MR URLs via a single tool (review_url_code), integrating with Cursor, Claude Code, Claude Desktop, and GitHub Copilot through OAuth or Bearer token authentication.1MIT- FlicenseAqualityCmaintenanceAn MCP server that brings GitHub workflow tools (repo, PR, issue, CI) and cost-free LLM-powered engineering tools (PR review, issue triage, commit messages) to any MCP client via the Groq free tier.17-