MCP 服务器

code-explainer

io.github.lazymac2x/code-explainer
开发者工具 公开且可连接 MCP 2026-07-28

此 MCP 可以做什么

Analyzes source code by detecting its language, explaining structure, generating documentation, measuring complexity, and suggesting refactoring.

analyze_all
Run all five analyses in one call: language detection, natural-language explanation, docstring generation, complexity metrics, and refactoring suggestions.
输入模式
{'type': 'object', 'required': ['code'], 'properties': {'code': {'type': 'string', 'description': 'The code snippet to analyze'}, 'language': {'type': 'string', 'description': 'Programming language (optional, auto-detected if omitted)'}}}
analyze_complexity
Analyze code complexity including cyclomatic complexity, cognitive complexity, nesting depth, and maintainability index.
输入模式
{'type': 'object', 'required': ['code'], 'properties': {'code': {'type': 'string', 'description': 'The code snippet to analyze'}, 'language': {'type': 'string', 'description': 'Programming language (optional, auto-detected if omitted)'}}}
detect_language
Detect the programming language of a code snippet. Returns the detected language and confidence level.
输入模式
{'type': 'object', 'required': ['code'], 'properties': {'code': {'type': 'string', 'description': 'The code snippet to analyze'}}}
explain_code
Generate a natural language explanation of a code snippet including structural analysis, features, and summary.
输入模式
{'type': 'object', 'required': ['code'], 'properties': {'code': {'type': 'string', 'description': 'The code snippet to explain'}, 'language': {'type': 'string', 'description': 'Programming language (optional, auto-detected if omitted)'}}}
generate_docstring
Generate JSDoc, Python docstring, Go godoc, or Rust doc comments for functions in the provided code.
输入模式
{'type': 'object', 'required': ['code'], 'properties': {'code': {'type': 'string', 'description': 'The code snippet containing functions to document'}, 'language': {'type': 'string', 'description': 'Programming language (optional, auto-detected if omitted)'}}}
suggest_refactor
Get prioritized refactoring suggestions for code quality improvements.
输入模式
{'type': 'object', 'required': ['code'], 'properties': {'code': {'type': 'string', 'description': 'The code snippet to review for refactoring opportunities'}, 'language': {'type': 'string', 'description': 'Programming language (optional, auto-detected if omitted)'}}}
已添加
analyze_all
2026年9月17日 12:43
已添加
suggest_refactor
2026年9月17日 12:43
已添加
analyze_complexity
2026年9月17日 12:43
已添加
generate_docstring
2026年9月17日 12:43
已添加
explain_code
2026年9月17日 12:43
已添加
detect_language
2026年9月17日 12:43