@zsc-glitch/code-review-mcp
v0.1.0-alpha.1
Published
MCP Server for Code Review - AI-powered code analysis for hermes-agent, Claude Code, Cursor
Maintainers
Readme
Code Review MCP
MCP Server for Code Review - AI-powered code analysis for hermes-agent, Claude Code, Cursor
安装
npm install @zsc-glitch/code-review-mcpMCP Tools
1. code_review_file
审查单个代码文件:
{
"tool": "code_review_file",
"arguments": {
"filePath": "/path/to/file.ts"
}
}返回:
- 评分 (0-100)
- 问题列表(安全、性能、样式)
- 改进建议
2. code_review_project
审查整个项目:
{
"tool": "code_review_project",
"arguments": {
"projectPath": "/path/to/project"
}
}返回:
- 文件数统计
- 平均评分
- 关键问题数量
- 需改进的文件列表
3. code_check_security
检查安全漏洞:
{
"tool": "code_check_security",
"arguments": {
"filePath": "/path/to/file.ts"
}
}检测:
- XSS 漏洞
- 代码注入 (eval)
- 硬编码密钥
- 不安全 DOM 操作
4. code_check_style
检查代码风格:
{
"tool": "code_check_style",
"arguments": {
"filePath": "/path/to/file.ts"
}
}检测:
- console.log 遗留
- var 声明
- 其他风格问题
5. code_get_suggestions
获取改进建议:
{
"tool": "code_get_suggestions",
"arguments": {
"filePath": "/path/to/file.ts"
}
}返回针对性的改进建议。
检查规则
| 类型 | 规则 | 严重程度 | |------|------|---------| | 安全 | eval() 代码注入 | Critical | | 安全 | innerHTML XSS | High | | 安全 | 硬编码密码/API Key | Critical | | 安全 | document.write XSS | High | | 性能 | 式 forEach | Medium | | 样式 | console.log | Low | | 样式 | var 声明 | Medium |
与 hermes-agent 配合
{
"mcpServers": {
"code-review": {
"command": "node",
"args": ["path/to/code-review-mcp/dist/index.js"]
}
}
}Made with ❤️ by 小影
