AI Code Review MCP Server
Allows review of git diffs and file changes for code review.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AI Code Review MCP Server Review this Python function for code quality"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AI Code Review MCP Server
一个基于 Model Context Protocol (MCP) 的代码审查工具服务器,提供多维度的代码审查和打分功能。
功能特性
🔍 代码整体审查 - 审查完整代码并生成提示词
📝 Git Diff 审查 - 审查代码变更差异
📄 单文件审查 - 针对特定文件的审查
🎯 智能评分解析 - 从审查文本中提取结构化评分
🎨 多种审查风格 - 支持专业、讽刺、温和、幽默四种风格
Related MCP server: Review-Code
工具列表
review_code
构建用于代码整体审查与打分的 LLM 提示词
参数:
code(string, 必需): 待审查的代码文本style(enum, 可选): 审查风格 -professional|sarcastic|gentle|humorouscommitMessage(string, 可选): 提交信息
review_diff
构建用于 Git diff 变更审查与打分的 LLM 提示词
参数:
diff(string, 必需): git diff 内容style(enum, 可选): 审查风格commitMessage(string, 可选): 提交信息
review_file
构建用于单文件审查与打分的 LLM 提示词
参数:
filePath(string, 必需): 文件路径content(string, 必需): 文件内容style(enum, 可选): 审查风格commitMessage(string, 可选): 提交信息
parse_review_score
从审查文本中解析评分(提取 '总分:XX分' 格式)
参数:
reviewText(string, 必需): 审查文本,应包含 '总分:XX分' 格式的评分
安装
方式一:全局安装
npm install -g lebo-ai-codereview-mcp方式二:本地安装
npm install lebo-ai-codereview-mcp方式三:从源码安装
git clone <repository-url>
cd ai-codereview-mcp
npm install
npm run build使用方法
在 Claude Desktop 中使用
找到 Claude Desktop 的配置文件位置:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
编辑配置文件,添加 MCP 服务器配置:
{
"mcpServers": {
"ai-codereview": {
"command": "npx",
"args": [
"-y",
"lebo-ai-codereview-mcp"
]
}
}
}或者如果已全局安装:
{
"mcpServers": {
"ai-codereview": {
"command": "lebo-ai-codereview-mcp"
}
}
}如果从本地路径安装:
{
"mcpServers": {
"ai-codereview": {
"command": "node",
"args": [
"/path/to/ai-codereview-mcp/dist/index.js"
]
}
}
}重启 Claude Desktop
使用 MCP Inspector 调试
启动开发服务器:
npm run dev在另一个终端启动 Inspector:
npx @modelcontextprotocol/inspector在浏览器中:
选择传输方式:Streamable HTTP
URL:
http://localhost:3000/mcp连接
详细说明请查看 DEBUG.md
环境变量
可以通过 .env 文件配置环境变量:
PORT=3000或者在启动时设置:
PORT=8080 npm run dev开发
# 安装依赖
npm install
# 构建项目
npm run build
# 开发模式(支持 Inspector)
npm run dev
# 监听模式构建
npm run watch项目结构
ai-codereview-mcp/
├── src/
│ ├── index.ts # 主入口(Stdio 模式,用于生产)
│ ├── dev-server.ts # 开发服务器(HTTP 模式,用于调试)
│ ├── prompts.ts # 提示词生成逻辑
│ ├── parser.ts # 评分解析逻辑
│ ├── types.ts # TypeScript 类型定义
│ └── tools/ # MCP 工具实现
│ ├── review-code.ts
│ ├── review-diff.ts
│ ├── review-file.ts
│ └── parse-score.ts
├── dist/ # 编译输出
├── scripts/
│ └── post-build.js # 构建后处理脚本
├── package.json
└── README.md许可证
MIT
相关链接
Available Tools
4 toolsparse_review_scoreA
从审查文本中解析评分(提取 '总分:XX分' 格式)
Inputs: reviewText (required).
review_codeB
构建用于代码整体审查与打分的 LLM 提示词(不直接调用 LLM)
Inputs: code (required), style, commitMessage.
review_diffA
构建用于 Git diff 变更审查与打分的 LLM 提示词(不直接调用 LLM)
Inputs: diff (required), style, commitMessage.
review_fileB
构建用于单文件审查与打分的 LLM 提示词(不直接调用 LLM)
Inputs: content (required), filePath (required), style, commitMessage.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct aspect of code review: overall code review, diff review, single file review, and score parsing. There is no overlap, so an agent can clearly differentiate them.
All tools use a consistent verb_noun pattern in snake_case: review_code, review_diff, review_file, parse_review_score. The naming is predictable and follows a clear convention.
With 4 tools, the server is well-scoped for generating code review prompts and parsing scores. The count is neither too few nor excessive, matching the narrow domain perfectly.
The server covers the main prompt generation scenarios (code, diff, file) and score parsing. A minor gap is the lack of a tool to extract detailed review comments, but for prompt generation and score extraction it is sufficiently complete.
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Repository knowledge graph MCP server for codebase understanding and debugging.
MCP server for static security analysis of Android source code
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA server that implements the Model Context Protocol (MCP) for orchestrating code reviews using a multi-agent system with Melchior, Balthasar, and Casper agents.2-
- AlicenseBqualityDmaintenanceA code review tool server based on Model Context Protocol (MCP), providing multi-dimensional code review and scoring functions.42Apache 2.0
- AlicenseNot gradedqualityFmaintenanceAn MCP server that provides senior-level code review, quality checks, security analysis, and refactoring suggestions directly in your editor.1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for automated code review using AI agents. It analyzes code diffs or file paths for bugs, security issues, and style violations.MIT