Smart Code Reviewer
Provides intelligent code analysis, security vulnerability detection, refactoring suggestions, and complexity calculations for JavaScript code
Generates automatic code documentation and comments in Markdown format
Provides intelligent code analysis, security vulnerability detection, refactoring suggestions, and complexity calculations for Python code
Click on "Install 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., "@Smart Code Revieweranalyze this Python function for security issues and suggest improvements"
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.
智能代码审查助手 MCP
一个基于 Model Context Protocol (MCP) 的强大工具,专为开发者提供全面的代码分析服务。它集成了代码质量评估、安全漏洞检测、智能重构建议、复杂度计算和文档生成等功能,支持多种编程语言如 JavaScript/TypeScript、Python 和 Java。通过自动化分析和优化建议,帮助提升代码的可维护性、安全性和性能。
✨ 主要特性
🔍 代码质量分析
多维度质量评估:代码行数、复杂度、可维护性指数等
问题检测:样式问题、性能问题、可维护性问题
多语言支持:JavaScript/TypeScript、Python、Java等
智能建议:提供具体的改进建议和最佳实践
🛡️ 安全漏洞检测
常见安全问题:硬编码密码、代码注入、SQL注入等
语言特定检测:XSS、原型污染、不安全反序列化等
风险评估:提供详细的风险评分和修复建议
CWE映射:与通用弱点枚举标准对应
🔧 智能重构建议
性能优化:循环优化、字符串拼接改进等
可读性提升:复杂条件简化、变量命名改进等
可维护性增强:重复代码提取、函数拆分等
现代化建议:使用最新语言特性和最佳实践
📊 复杂度分析
圈复杂度:McCabe复杂度计算
认知复杂度:代码理解难度评估
Halstead复杂度:程序复杂度的数学度量
可维护性指数:综合可维护性评分
📚 文档生成
多种格式:Markdown、JSDoc、内联注释
智能分析:自动提取函数、类、方法信息
使用示例:生成代码使用示例
API文档:完整的API文档生成
Related MCP server: CodeBase Optimizer
🚀 快速开始
安装依赖
npm install构建项目
npm run build启动服务器
npm start开发模式
npm run dev🛠️ 工具说明
1. analyze_code_quality
分析代码质量,检测潜在问题和改进建议。
参数:
code(string): 要分析的代码内容language(string): 编程语言filename(string, 可选): 文件名
示例:
{
"code": "function example() { var x = 1; if (x == 1) console.log('test'); }",
"language": "javascript",
"filename": "example.js"
}2. generate_documentation
为代码生成详细的文档和注释。
参数:
code(string): 要生成文档的代码language(string): 编程语言docType(string): 文档类型 (inline/markdown/jsdoc)
示例:
{
"code": "function calculateSum(a, b) { return a + b; }",
"language": "javascript",
"docType": "markdown"
}3. detect_security_issues
检测代码中的安全漏洞和风险。
参数:
code(string): 要检测的代码language(string): 编程语言
示例:
{
"code": "const password = 'hardcoded123'; eval(userInput);",
"language": "javascript"
}4. suggest_refactoring
提供代码重构建议,改善代码结构和可读性。
参数:
code(string): 要重构的代码language(string): 编程语言focus(string): 重构重点 (performance/readability/maintainability/all)
示例:
{
"code": "for(var i=0;i<arr.length;i++){if(arr[i]==target){return i;}}",
"language": "javascript",
"focus": "performance"
}5. calculate_complexity
计算代码复杂度指标。
参数:
code(string): 要分析的代码language(string): 编程语言
示例:
{
"code": "function complexFunction(x) { if (x > 0) { for (let i = 0; i < x; i++) { if (i % 2 === 0) { console.log(i); } } } }",
"language": "javascript"
}📋 支持的编程语言
JavaScript/TypeScript: 全功能支持
Python: 全功能支持
Java: 全功能支持
SQL: 安全检测支持
其他语言: 基础分析支持
🎯 使用场景
代码审查
在代码审查过程中,使用本工具快速识别代码质量问题、安全漏洞和改进机会。
重构指导
在重构代码时,获得具体的重构建议和优先级指导。
安全审计
在安全审计中,自动检测常见的安全漏洞和风险点。
文档生成
自动生成代码文档,提高项目的可维护性。
教学辅助
帮助开发者学习最佳实践和代码质量标准。
📊 分析报告示例
代码质量分析报告
{
"filename": "example.js",
"language": "javascript",
"metrics": {
"linesOfCode": 45,
"complexity": 8,
"maintainabilityIndex": 72.5
},
"issues": [
{
"type": "style",
"severity": "warning",
"message": "建议使用let或const替代var",
"line": 3,
"rule": "no-var"
}
],
"overallScore": 85,
"recommendations": [
"使用现代JavaScript语法",
"添加错误处理机制"
]
}安全扫描报告
{
"language": "javascript",
"totalIssues": 2,
"criticalIssues": 1,
"riskScore": 15,
"issues": [
{
"type": "hardcoded-credentials",
"severity": "critical",
"message": "检测到硬编码的敏感信息",
"cwe": "CWE-798",
"recommendation": "使用环境变量存储敏感信息"
}
]
}🔧 配置选项
环境变量
MCP_LOG_LEVEL: 日志级别 (debug/info/warn/error)MCP_MAX_CODE_SIZE: 最大代码大小限制MCP_TIMEOUT: 分析超时时间
自定义规则
可以通过配置文件自定义分析规则和阈值。
🤝 贡献指南
欢迎贡献代码!请遵循以下步骤:
Fork 本仓库
创建特性分支 (
git checkout -b feature/AmazingFeature)提交更改 (
git commit -m 'Add some AmazingFeature')推送到分支 (
git push origin feature/AmazingFeature)开启 Pull Request
📝 许可证
本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。
🙏 致谢
Model Context Protocol 团队
开源社区的贡献者们
代码质量分析领域的研究者们
📞 联系我们
如有问题或建议,请通过以下方式联系:
提交 Issue
发送邮件
参与讨论
让代码审查变得更智能、更高效! 🚀
Available Tools
5 toolsanalyze_code_qualityC
分析代码质量,检测潜在问题和改进建议
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 要分析的代码内容 | |
| language | Yes | 编程语言 (javascript, typescript, python, java, etc.) | |
| filename | No | 文件名(可选) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions detecting problems and suggesting improvements, but lacks details on what types of problems (e.g., bugs, performance, style), the format of suggestions, whether analysis is static/dynamic, computational requirements, or error handling. For a tool with no annotation coverage, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence in Chinese that directly states the tool's function. It's appropriately concise without unnecessary words, though it could be slightly more structured by separating problem detection from suggestion generation for clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (code analysis with multiple potential outputs), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the analysis returns (e.g., issues list, scores, recommendations), how results are structured, or any limitations. This leaves significant gaps for an agent to use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional meaning about parameters beyond what's in the schema (e.g., no examples, constraints, or usage notes). Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '分析代码质量,检测潜在问题和改进建议' (analyze code quality, detect potential problems and improvement suggestions). It specifies the verb 'analyze' and resource 'code quality' with additional outcomes. However, it doesn't explicitly differentiate from siblings like 'detect_security_issues' or 'suggest_refactoring' which might overlap in scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. With siblings like 'detect_security_issues' and 'suggest_refactoring' that might handle similar aspects of code analysis, there's no indication of scope boundaries, prerequisites, or comparative use cases. This leaves the agent guessing about tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
calculate_complexityC
计算代码复杂度指标(圈复杂度、认知复杂度等)
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 要分析的代码 | |
| language | Yes | 编程语言 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on behavioral traits: it doesn't specify if this is a read-only analysis, what the output format might be (since no output schema exists), potential performance implications, or error handling. For a tool with no annotations, this leaves significant gaps in understanding its operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise—a single sentence in Chinese that directly states the tool's purpose without any fluff. It's front-loaded with the core action and resource, making it efficient and easy to parse. Every word earns its place by specifying the metrics involved.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of calculating code complexity metrics, the description is incomplete. There are no annotations to clarify behavior, no output schema to explain return values, and the description doesn't address what the tool outputs or how it handles different languages or code structures. For a tool with 2 parameters and no structured support, more context is needed to guide effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with clear documentation for both parameters ('code' and 'language'). The description doesn't add any semantic details beyond what the schema provides (e.g., it doesn't explain what '圈复杂度' or '认知复杂度' entail in terms of input requirements). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate or enhance parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '计算代码复杂度指标(圈复杂度、认知复杂度等)' (calculate code complexity metrics like cyclomatic complexity, cognitive complexity, etc.). It specifies the verb '计算' (calculate) and the resource '代码复杂度指标' (code complexity metrics). However, it doesn't explicitly differentiate from sibling tools like 'analyze_code_quality' or 'suggest_refactoring', which might also involve complexity analysis.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or contexts where this tool is preferred over others (e.g., 'analyze_code_quality' might include complexity as part of broader analysis). There's no indication of prerequisites, exclusions, or specific scenarios for usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
detect_security_issuesC
检测代码中的安全漏洞和风险
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 要检测的代码 | |
| language | Yes | 编程语言 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does (detects security issues) but doesn't describe how it behaves: whether it's read-only or destructive, what permissions are needed, how results are returned, or any rate limits. For a security analysis tool with zero annotation coverage, this leaves significant gaps in understanding operational characteristics.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence in Chinese that directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded with the essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a security analysis tool with no annotations and no output schema, the description is incomplete. It doesn't explain what types of vulnerabilities are detected, how results are formatted, whether it's a lightweight scan or deep analysis, or any limitations. For a tool that presumably returns important security findings, more context about output and behavior is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters (code and language) with descriptions. The tool description doesn't add any parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '检测代码中的安全漏洞和风险' clearly states the tool's purpose as detecting security vulnerabilities and risks in code, using specific verbs ('检测') and resources ('代码中的安全漏洞和风险'). It distinguishes from siblings like analyze_code_quality (general quality) and calculate_complexity (complexity metrics), but doesn't explicitly mention this differentiation in the description text itself.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like analyze_code_quality or suggest_refactoring. It doesn't specify prerequisites, context, or exclusions. The agent must infer usage from the purpose alone without explicit direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_documentationC
为代码生成详细的文档和注释
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 要生成文档的代码 | |
| language | Yes | 编程语言 | |
| docType | Yes | 文档类型 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('生成' - generate) but doesn't disclose any behavioral traits like whether this is a read-only operation, if it requires specific permissions, what the output format might be, or any rate limits. For a tool with no annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and front-loaded: '为代码生成详细的文档和注释' (generate detailed documentation and comments for code). It's a single, clear sentence with no wasted words, making it easy to understand at a glance. Every word earns its place by directly stating the tool's purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a documentation generation tool with 3 required parameters and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., formatted documentation text), any behavioral aspects like error handling, or how it interacts with sibling tools. With no annotations and no output schema, the description should provide more context to be fully helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds no meaning beyond what the input schema provides. The schema has 100% description coverage, with clear parameter descriptions (e.g., '要生成文档的代码' - code to generate documentation for, '编程语言' - programming language, '文档类型' - documentation type with enum values). Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate with additional semantic context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '为代码生成详细的文档和注释' (generate detailed documentation and comments for code). It specifies the verb '生成' (generate) and the resource '文档和注释' (documentation and comments). However, it doesn't explicitly differentiate from sibling tools like 'analyze_code_quality' or 'suggest_refactoring', which might also involve code analysis but for different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions, such as when to choose 'generate_documentation' over 'suggest_refactoring' for code improvement tasks. Without such guidance, users might struggle to select the appropriate tool among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
suggest_refactoringC
提供代码重构建议,改善代码结构和可读性
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 要重构的代码 | |
| language | Yes | 编程语言 | |
| focus | No | 重构重点 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool provides suggestions to improve code structure and readability, implying a read-only, advisory function. However, it lacks details on critical behaviors: whether it modifies code, requires specific permissions, has rate limits, returns structured advice or examples, or handles errors. For a tool with no annotations, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and front-loaded: a single sentence in Chinese that directly states the tool's purpose. There's no wasted language or redundancy, making it easy for an agent to parse quickly. Every word earns its place by defining the core function without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a code refactoring tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., suggestions, examples, scores), behavioral traits like safety or limitations, or how it differs from siblings. For a tool that likely provides nuanced advice, more context is needed to help the agent use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with clear descriptions for all parameters ('code', 'language', 'focus'), including an enum for 'focus'. The description adds no additional semantic information beyond what's in the schema—it doesn't explain parameter interactions, default behaviors, or examples. Given the high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '提供代码重构建议,改善代码结构和可读性' (Provide code refactoring suggestions to improve code structure and readability). It specifies the verb '提供建议' (provide suggestions) and the resource '代码' (code), with the goal of improving structure and readability. However, it doesn't explicitly distinguish this from sibling tools like 'analyze_code_quality' or 'generate_documentation', which might have overlapping purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'analyze_code_quality' (which might analyze without suggesting refactoring) or 'generate_documentation' (which focuses on documentation). There's no context on prerequisites, limitations, or specific scenarios where this tool is preferred over others, leaving the agent to infer usage from the purpose alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
- First observed
analyze_code_quality - First observed
calculate_complexity - First observed
detect_security_issues - First observed
generate_documentation - First observed
suggest_refactoring
TDQS
Each tool has a clearly distinct purpose with no overlap: code quality analysis, complexity calculation, security issue detection, documentation generation, and refactoring suggestions. An agent can easily differentiate between them based on their specific focus areas.
All tool names follow a consistent verb_noun pattern (e.g., analyze_code_quality, calculate_complexity) using snake_case throughout. The naming is predictable and readable across all five tools.
With 5 tools, this server is well-scoped for a code review domain. Each tool earns its place by covering distinct aspects of code review (quality, complexity, security, documentation, refactoring), avoiding bloat or thinness.
The tool set provides complete coverage for a code review server, addressing key areas like quality analysis, complexity metrics, security scanning, documentation, and refactoring. There are no obvious gaps that would hinder an agent's workflow.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Related MCP Servers
- FlicenseBqualityNot gradedmaintenanceProvides comprehensive codebase analysis and semantic understanding through integrated knowledge graphs, enabling AI assistants to understand project structure, patterns, dependencies, and context through multiple analysis tools and format generators.9-
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive codebase analysis including project structure evaluation, cross-language duplicate detection, microservices validation, and configuration optimization with AI-powered pattern learning that generates actionable improvement reports.MIT
- AlicenseNot gradedqualityDmaintenanceProvides advanced code structure and semantic analysis through Abstract Syntax Trees (AST) and Abstract Semantic Graphs (ASG) across multiple programming languages. It enables tasks like incremental parsing, complexity analysis, and AST diffing to help models understand and navigate codebases.36MIT
- AlicenseAqualityDmaintenanceProvides comprehensive code quality analysis with quantitative metrics, historical trends, and refactoring risk prediction for C#, Python, and TypeScript codebases.520MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/renjismzy/mcp-code'
If you have feedback or need assistance with the MCP directory API, please join our Discord server