code-review-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| review_changesA | 审查一个 git 变更,返回「审查证据包」:改了哪些文件、风险在哪、新增行命中了什么。 这是本服务器的旗舰工具。它只返回事实,不返回审查结论——每一条 findings/signal 都需要审查者回到源码确认后再决定是否成立、什么级别。 Args: scope: 审查范围。 - "working"(默认):所有未提交改动 = 未暂存 + 已暂存 + 未跟踪文件(含源码与配置) - "staged":只审已暂存(git add 过的) - "base":审 base...HEAD(git merge-base 三点差异),必须同时给 base base: 基线分支/提交,如 "main"、"origin/main"、commit sha;仅 scope="base" 时使用 directory: 仓库目录(也可以是仓库内子目录,此时只审该子目录下的变更), 默认当前工作目录 返回: - scope / range / base_commit / head_commit - stats:文件数、增删行、按状态分组、语言分布 - files[]:每个变更文件含 path、status、additions、deletions、language、 priority(high/medium/low)、signals、findings(只含新增行命中,按行号排序)、 function_deltas(Python 函数圈复杂度/长度前后对比) - signals[]:变更级信号(dependency_added / database_schema / ci_or_build / api_contract / test_change / secret_added / security_finding / large_change / config_change);只有 SEC005(硬编码密钥)记为 secret_added,其余安全命中记为 security_finding - focus[]:按风险排序的深审入口(形如 "path:line — 描述") - limits:skipped(被跳过的文件及原因)、truncated、notes 使用顺序:focus → priority=high 的文件 → signals → limits。 需要看调用方、类型定义、测试时直接读文件;不要只凭本工具输出下结论。 非 git 仓库会返回 {"error", "hint"},单文件场景请改用 analyze_file。 |
| analyze_fileA | 分析单个文件的代码质量、复杂度和安全问题。 会运行所有适用的规则:
返回语言、代码/注释/空白行数、issues(含 rule id、severity、category、confidence、 suggestion)与多维评分(overall / security / maintainability,A-F)。 评分是文件健康度参考,不是审查结论。 Args: file_path: 要分析的文件路径(相对于项目根目录或绝对路径) |
| review_diffA | [已弃用] 审查当前 git 仓库中未提交的变更(staged + unstaged)。 保留仅为兼容 v0.2.x 调用方;新代码请使用 review_changes,它提供变更级信号、 只报新增行、复杂度回归与风险焦点,且覆盖 working/staged/base 三种范围。 本工具对 diff 新增行做以下检测(DIFF001-DIFF004):
|
| check_projectA | 扫描项目目录的代码质量概况。 遍历项目下所有支持的源代码文件(Python/JS/TS/Java/Go/Rust 等), 对每个文件运行完整规则集,最后汇总:
适合在不熟悉的仓库里摸底,不要把它当审查结论。 Args: directory: 要扫描的项目目录路径,默认为当前目录 |
| list_rulesA | 列出所有已注册的代码审查规则,便于 AI 选择性调用。 返回每条规则的 ID、名称、描述、类别和默认严重级别。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
review_changes and the deprecated review_diff substantially overlap, both auditing uncommitted git changes, so an agent could misselect despite the explicit deprecation note. analyze_file, check_project, and list_rules are clearly distinct from each other and from the review tools.
All five tools follow a consistent snake_case verb_noun pattern (review_changes, analyze_file, review_diff, check_project, list_rules). No mixed conventions or vague verbs.
Five tools is a well-scoped set for a code-review server covering diff review, single-file analysis, project scan, and rule discovery. The count is slightly inflated by one deprecated tool kept only for backward compatibility.
The domain (local code review/quality analysis) is well covered: change review with scope options, file analysis, project-wide scanning, and rule enumeration. Minor gaps exist, e.g. no way to configure or filter rules or to compare against a saved baseline report, but core workflows are complete.