@shareworker/code-review-mcp
Official@shareworker/code-review-mcp
English
An MCP server that exposes the deterministic engineering layer of code review as tools, callable by host agents (Claude Code, Codex, Devin) within their own LLM loops. The server never calls an LLM — all reasoning happens in the host session.
Why
General-purpose agents doing code review via Skills suffer from: incomplete coverage (skipping files on large changesets), position drift (line numbers don't match actual code), and unstable quality (minor prompt variations cause large quality swings). This server enforces hard constraints on the review process — file selection, smart bundling, rule matching, comment positioning, and comment reflection — so quality is stable regardless of host model variation.
Tools
Tool | Purpose |
| Git diff → file filtering → |
| Smart bundling (test/source + i18n) with 20000 char cap |
| Path-based rule matching → |
| Text match + hunk align → precise line numbers |
| Deterministic validation (keep/drop) — no LLM |
Installation
Claude Code
Add to .claude/mcp.json:
{
"mcpServers": {
"code-review": {
"command": "npx",
"args": ["-y", "@shareworker/code-review-mcp"]
}
}
}Copy the skill to .claude/skills/:
mkdir -p .claude/skills/code-review
cp skills/code-review/SKILL.md .claude/skills/code-review/SKILL.mdCodex
Add to your Codex MCP configuration:
{
"mcpServers": {
"code-review": {
"command": "npx",
"args": ["-y", "@shareworker/code-review-mcp"]
}
}
}Copy the skill to Codex's skill directory:
cp skills/code-review/SKILL.md <codex-skills-dir>/code-review/SKILL.mdDevin
Add to .devin/config.json:
{
"mcpServers": {
"code-review": {
"command": "npx",
"args": ["-y", "@shareworker/code-review-mcp"]
}
}
}Copy the skill to .devin/skills/:
mkdir -p .devin/skills/code-review
cp skills/code-review/SKILL.md .devin/skills/code-review/SKILL.mdConfiguration
Create .code-review/rules.json in your repo (or ~/.code-review/rules.json
for global config):
{
"filters": {
"exclude": ["**/*.lock", "**/*.min.js", "**/*.map"],
"include": ["**/*.ts", "**/*.js"]
},
"rules": [
{
"path": "**/*.ts",
"rule": "Check for any types and proper null handling"
},
{
"path": "**/*mapper*.xml",
"rule": "Check SQL for injection risks and missing closing tags"
}
]
}Configuration Resolution Priority
--rule <path>flag (highest) — not exposed via MCP, reserved for future CLI<repo>/.code-review/rules.json— project-level~/.code-review/rules.json— global/user-levelBuilt-in defaults (lowest) — covers correctness, security, performance, maintainability, test coverage
For MVP, only layers 2-4 are active (no --rule flag since there's no CLI).
The first matching user rule replaces the built-in system rule at the same layer.
filters
exclude: glob patterns for files to exclude (merged with built-in defaults)include: glob patterns — when present, only matching files are reviewed
rules
Array of { "path": "<glob>", "rule": "<text>" }. First match wins. The rule
text is returned as prompt_section for the host LLM to inject into its review
prompt.
Development
npm install
npm run build # compile TypeScript
npm test # run unit tests
npm run dev # watch modeLicense
MIT
Related MCP server: mcp_review_code_tool
中文
一个 MCP 服务器,将代码审查的确定性工程层封装为工具,供宿主代理(Claude Code、 Codex、Devin)在自身的 LLM 循环中调用。服务器自身不调用任何 LLM —— 所有推理 都在宿主会话中完成。
为什么需要
通用代理通过 Skill 做代码审查时存在三大问题:覆盖不完整(大变更集时跳过文件)、 定位漂移(行号与实际代码不匹配)、质量不稳定(提示词微小变化导致质量大幅波动)。 本服务器对审查流程施加硬约束 —— 文件选择、智能打包、规则匹配、评论定位、 评论反思 —— 使质量不受宿主模型变化影响。
工具
工具 | 职责 |
| Git diff → 文件过滤 → 返回 |
| 智能打包(测试/源码配对 + i18n 配对),20000 字符上限 |
| 路径匹配规则 → 返回 |
| 文本匹配 + hunk 对齐 → 精确行号 |
| 确定性验证(保留/丢弃)—— 不调用 LLM |
安装
Claude Code
添加到 .claude/mcp.json:
{
"mcpServers": {
"code-review": {
"command": "npx",
"args": ["-y", "@shareworker/code-review-mcp"]
}
}
}将 skill 复制到 .claude/skills/:
mkdir -p .claude/skills/code-review
cp skills/code-review/SKILL.md .claude/skills/code-review/SKILL.mdCodex
添加到 Codex 的 MCP 配置:
{
"mcpServers": {
"code-review": {
"command": "npx",
"args": ["-y", "@shareworker/code-review-mcp"]
}
}
}将 skill 复制到 Codex 的 skill 目录:
cp skills/code-review/SKILL.md <codex-skills-dir>/code-review/SKILL.mdDevin
添加到 .devin/config.json:
{
"mcpServers": {
"code-review": {
"command": "npx",
"args": ["-y", "@shareworker/code-review-mcp"]
}
}
}将 skill 复制到 .devin/skills/:
mkdir -p .devin/skills/code-review
cp skills/code-review/SKILL.md .devin/skills/code-review/SKILL.md配置
在仓库中创建 .code-review/rules.json(或 ~/.code-review/rules.json 作为全局配置):
{
"filters": {
"exclude": ["**/*.lock", "**/*.min.js", "**/*.map"],
"include": ["**/*.ts", "**/*.js"]
},
"rules": [
{
"path": "**/*.ts",
"rule": "检查 any 类型和空值处理"
},
{
"path": "**/*mapper*.xml",
"rule": "检查 SQL 注入风险和标签闭合"
}
]
}配置优先级
--rule <path>命令行参数(最高)—— MCP 未暴露,预留给未来 CLI<repo>/.code-review/rules.json—— 项目级~/.code-review/rules.json—— 全局/用户级内置默认规则(最低)—— 覆盖正确性、安全性、性能、可维护性、测试覆盖率
MVP 版本仅启用 2-4 层(无 CLI 故无 --rule 参数)。同一层中首个匹配的用户规则
替换内置系统规则。
filters
exclude:排除文件的 glob 模式(与内置默认黑名单合并)include:包含文件的 glob 模式 —— 存在时仅审查匹配的文件
rules
{ "path": "<glob>", "rule": "<文本>" } 数组。首个匹配生效。rule 文本作为
prompt_section 返回,供宿主 LLM 注入审查提示词。
开发
npm install
npm run build # 编译 TypeScript
npm test # 运行单元测试
npm run dev # 监听模式许可证
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/shareworker/code-review'
If you have feedback or need assistance with the MCP directory API, please join our Discord server