Skip to main content

CodeDoc MCP

CodeDoc MCP是一个强大的代码分析和文档生成工具,支持多种编程语言,能够自动生成Markdown文档和Mermaid图表。

功能特点

  • 多语言支持:支持Python、C#、C++、JavaScript和Unity着色器等多种编程语言
  • 文档生成:自动生成详细的Markdown格式文档
  • 图表生成:生成Mermaid格式的类图、流程图和结构图
  • MCP服务:提供MCP服务器接口,方便集成到其他工具中
  • 批量处理:支持对整个目录进行批量分析和文档生成

安装方法

pip install codedoc_mcp

快速开始

命令行使用

# 分析单个文件
codedoc_mcp analyze --file path/to/your/file.py --output docs

# 分析整个目录
codedoc_mcp analyze-dir --dir path/to/your/project --output docs

Python代码中使用

from codedoc_mcp import analyze_code_file, analyze_directory

# 分析单个文件
result = analyze_code_file(
    file_path="path/to/your/file.py",
    output_dir="docs",
    generate_markdown=True,
    generate_class_diagram=True
)

# 分析整个目录
result = analyze_directory(
    directory_path="path/to/your/project",
    output_dir="docs",
    file_extensions=[".py", ".cs"],
    recursive=True
)

支持的文件类型

  • Python (.py)
  • C# (.cs)
  • C++ (.cpp, .h, .hpp, .cc)
  • JavaScript/TypeScript (.js, .jsx, .ts, .tsx)
  • Unity着色器 (.shader, .compute, .cginc, .hlsl)

文档示例

生成的Markdown文档

生成的Markdown文档包含以下内容:

  • 类和接口的详细描述
  • 方法和函数的参数、返回值和文档字符串
  • 属性和字段的类型和描述
  • 继承关系和依赖关系

生成的Mermaid图表

生成的Mermaid图表包括:

  • 类图:展示类之间的继承和关联关系
  • 流程图:展示函数调用流程
  • 结构图:展示项目结构和模块依赖关系

许可证

MIT

Metadata

Release files for codedoc-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codedoc-mcp 0.1.0
File Size Uploaded Provenance
codedoc_mcp-0.1.0.tar.gz 10.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for codedoc-mcp 0.1.0
File Interpreter ABI Platform
codedoc_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.0 kB

Release files / codedoc_mcp-0.1.0.tar.gz

Download URL codedoc_mcp-0.1.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
12fa70b3b6fee77c46bb9b061010ef2fe25cc2211b8fe596d18c051b56c5a44a
BLAKE2b-256 checksum
How to use checksums
ecf591b9151323fc366849d6fe5e8bcbfd6004325147cf76ea8cdea311a56a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.0

Release files / codedoc_mcp-0.1.0-py3-none-any.whl

Download URL codedoc_mcp-0.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92a6667257e069f74733c8e6d201343ffeebbba212ff16d629d1eda6012e2d33
BLAKE2b-256 checksum
How to use checksums
413975b84af16b81a2bcf333c3fcde8fc47110261f807d01a80564aa53b25218
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.0

Security for codedoc-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page