critique-mcp
critique-mcp
一个 MCP 服务器,它让智能体真正拥有审查 pull request 的能力——不只是概括 diff,而是把 diff 拆开、对变更的代码运行 lint、在测试没有被更新时标记出来,并把一份真实的 review 提交回 GitHub。
Python · Model Context Protocol · GitHub REST API
工具
工具 | 功能说明 |
| PR 中变更的文件,附带 diff 统计和补丁文本 |
| 标记那些修改了源文件却未触及任何测试文件的 PR |
| 在 PR 的 head commit 上对每个变更的 Python 文件运行 |
| 在 PR 上提交真正的 review(评论 / 批准 / 请求变更) |
每个工具都是一个精简、可独立测试的函数——run_linter 不知道 check_test_coverage 是怎么工作的,二者除了经由 GitHubClient 之外也都不与 GitHub 通信。由智能体决定如何组合它们;这个服务器只是给它一双手。
check_test_coverage 是一种 PR 级别的启发式检查,而不是逐文件的覆盖率插桩:它标记的是“这个 PR 改动源文件,但整个 PR 里连一个测试文件都没碰”,这和 Danger.js 等工具使用的粗粒度信号一致。一个改动了五个源文件、但顺带只动了一个无关测试的 PR 不会被标记被拦截——更精确的版本需要真实的覆盖率数据,而不是文件名。
Related MCP server: GitHub PR Reviewer
为什么会有这个项目
我曾在别人的 PR 中手工找到并修复过这些工具正好能捕获的那类 bug——比如 chroma-core/chroma 中一个空洞通过的测试断言,weaviate-python-client 中一个只检查了列表里某一个元素的校验器,以及 qdrant-client 里的浮点精度问题。这个项目把这种 review 流程变成了智能体可以直接调用的工具,而不是每次都要靠人手工做同样的检查。
环境要求
需要 Python 3.11+、PATH 里的 ruff,以及一个带 repo 权限的 GitHub personal access token(只读就够用了,除非你想让 post_review 正常工作)。
cp .env.example .env # then add your token to .env
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt使用
把它添加到 Claude Desktop / Claude Code 的 MCP 配置中:
{
"mcpServers": {
"critique": {
"command": "python",
"args": ["-m", "critique_mcp.server"],
"env": { "GITHUB_TOKEN": "ghp_..." }
}
}
}然后让智能体这样使用它:“用 critique 审查 owner/repo 上的 PR #42,检查 lint 问题和缺失的测试,然后提交一个总结性 review。”
测试
pytest测试中所有 GitHub API 调用都是 mock 的——除非你自己运行这个 server,否则这里的任何部分都不会发起真正的网络请求。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Assess pull requests and read verdicts, findings, evidence and suggested fixes from coding agents.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Live checks for agent-written code: missing packages, end-of-life versions, stale Actions, secrets.
Lets coding agents check their own code for leaked secrets, risky dependencies and AI-code mistakes
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides GitHub PR review capabilities to LLMs, enabling automated PR analysis, review submission, and inline commenting via MCP.1422 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables reviewing GitHub pull requests via ChatGPT, including listing PRs, viewing diffs, posting comments, approving, and requesting changes.MIT
- FlicenseAqualityDmaintenanceEnables LLM clients to list, read, review, and comment on GitHub pull requests, turning an AI assistant into a fully capable code reviewer.61-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to autonomously review GitHub Pull Requests by listing PRs, retrieving diffs, and submitting structured reviews.ISC