Token导航 LogoToken导航TokenDH.com
Document Automation MCP Server logo
开发工具stdio官方级别未说明来源级核验

Document Automation MCP Server

MCP Server

一个基于模型上下文协议(MCP)的服务器,提供智能代码库分析、全面文档生成和多格式导出功能。

工具数

0

提示词数

0

GitHub Stars

2

资源数

0
代码分析安全PythonClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

vedantparmar12

提供方

vedantparmar12

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

📚 文档自动化MCP服务器

![Python](https://www.python.org/downloads/) ![MCP](https://modelcontextprotocol.io) ![License](LICENSE) ![Code Style](https://github.com/psf/black)

一个强大的模型上下文协议(MCP)服务器,提供智能代码库分析、全面的文档生成和多格式导出功能。专为与Claude和其他AI助手无缝集成而构建。

______________________________________________________________________

✨ 特性

🔍 智能代码库分析

  • AST解析深入分析Python和JavaScript代码结构
  • 框架检测:自动识别框架(React、Flask、Django、FastAPI等)
  • 数据库模式分析:提取并可视化数据库关系
  • API端点发现:用方法和参数映射REST端点
  • 安全扫描:确定潜在漏洞和最佳做法
  • 依赖项跟踪:分析项目依赖关系和版本

📝 专业文档生成

  • 多种格式:Markdown、HTML、PDF、DOCX、Confluence、Notion、JSON、EPUB
  • 交互式文档:搜索、导航、语法高亮显示
  • 美人鱼图:体系结构、数据库ER、API流、依赖关系图
  • 多语言支持:内置国际化
  • 自定义主题:现代、简约、黑暗、企业等
  • 符合无障碍标准:WCAG 2.1 AA标准

🚀 高性能

  • 分页支持:高效处理大型存储库
  • 后台处理:异步分析以获得更好的性能
  • 智能分块:令牌感知内容拆分
  • 并行分析:并行文件处理
  • 出口自动化:批量导出为多种格式
  • 档案生成:拉链,柏油,柏油。GZ支持

______________________________________________________________________

📋 目录

______________________________________________________________________

🚀 安装

先决条件

  • Python 3.8或更高版本
  • Git
  • Claude Desktop或MCP兼容客户端

使用pip

# Clone the repository
git clone https://github.com/vedantparmar12/Document-Automation.git
cd Document-Automation

# Install dependencies
pip install -r requirements.txt

使用紫外线(推荐)

# Install uv (if not already installed)
pip install uv

# Install dependencies with uv
uv pip install -r requirements.txt

______________________________________________________________________

🎯 快速开始

1.配置克劳德桌面

将以下内容添加到您的Claude Desktop配置文件中:

视窗: %APPDATA%\Claude\claude_desktop_config.json\ macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "document-automation": {
      "command": "python",
      "args": [
        "C:\\path\\to\\Document-Automation\\run_server.py"
      ]
    }
  }
}

2.启动服务器

# Using Python directly
python run_server.py

# Or using uv
uv run python run_server.py

3.在Claude中使用

配置后,Claude可以分析代码库并生成文档:

Analyze this repository: https://github.com/username/repo
Generate comprehensive documentation in HTML format

______________________________________________________________________

⚙️ 配置

环境变量

创建一个 .env 项目根目录中的文件:

# Analysis Settings
MAX_FILES=1000
MAX_TOKENS_PER_CHUNK=4000
PAGINATION_STRATEGY=auto

# Security Settings
ENABLE_SECURITY_SCAN=true
CONTENT_FILTERING=true

# Export Settings
DEFAULT_OUTPUT_DIR=./docs
DEFAULT_THEME=modern
ENABLE_DIAGRAMS=true

MCP服务器配置

服务器可以通过以下方式配置 wrangler.toml 对于Cloudflare Workers部署:

name = "document-automation"
compatibility_date = "2024-01-01"

[env.production]
vars = { ENVIRONMENT = "production" }

______________________________________________________________________

📖 使用示例

分析本地代码库

from src.tools.consolidated_documentation_tools import analyze_codebase

result = analyze_codebase(
    path="/path/to/project",
    source_type="local",
    include_ast_analysis=True,
    include_mermaid_diagrams=True,
    include_security_analysis=True
)

print(f"Analysis ID: {result['analysis_id']}")
print(f"Total Files: {result['metrics']['total_files']}")
print(f"Frameworks: {result['technology_stack']['primary_technologies']}")

分析GitHub存储库

result = analyze_codebase(
    path="https://github.com/username/repo.git",
    source_type="github",
    include_api_endpoints=True,
    include_database_analysis=True
)

生成文档

from src.tools.consolidated_documentation_tools import generate_documentation

docs = generate_documentation(
    analysis_id="analysis_20241212_123456_789",
    format="interactive",
    theme="modern",
    include_toc=True,
    include_search=True,
    auto_export_formats=["pdf", "html", "markdown"]
)

print(f"Documentation generated: {docs['generated_files']}")

导出为多种格式

from src.tools.consolidated_documentation_tools import export_documentation

exports = export_documentation(
    analysis_id="analysis_20241212_123456_789",
    formats=["html", "pdf", "docx", "markdown"],
    theme="corporate",
    include_diagrams=True,
    accessibility_compliance=True,
    archive_formats=["zip"]
)

print(f"Exported {len(exports['exported_files'])} files")

______________________________________________________________________

🔌 api参考

核心工具

analyze_codebase

具有内置功能的全面代码库分析。

参数:

  • path (str):本地路径或GitHub URL
  • source_type (str):“本地”或“github”
  • include_ast_analysis (bool):启用AST解析
  • include_framework_detection (bool):检测框架
  • include_database_analysis (bool):分析数据库模式
  • include_mermaid_diagrams (bool):生成图表
  • include_api_endpoints (bool):提取API路由
  • include_security_analysis (bool):安全扫描
  • max_files (int):要分析的最大文件数(默认值:1000)
  • pagination_strategy (str):“auto”、“file_by_file”、“chunk_by-chock”、“smart”

退货:

{
    "success": bool,
    "analysis_id": str,
    "comprehensive_analysis": {
        "project_structure": {...},
        "dependencies": [...],
        "api_endpoints": [...],
        "mermaid_diagrams": {...},
        "security_analysis": {...}
    },
    "metrics": {...}
}

generate_documentation

生成具有所有内置功能的专业文档。

参数:

  • analysis_id (str):来自先前分析的ID
  • format (str):“markdown”、“html”、“pdf”、“交互式”等。
  • theme (str):“现代”、“极简”、“黑暗”、“企业”等。
  • include_toc (bool):目录
  • include_search (bool):搜索功能
  • include_navigation (bool):导航侧边栏
  • auto_export_formats (列表):其他导出格式

退货:

{
    "success": bool,
    "generated_files": [...],
    "documentation_stats": {...}
}

export_documentation

使用高级功能导出为多种格式。

参数:

  • analysis_id (str):来自先前分析的ID
  • formats (列表):导出格式
  • theme (str):文档主题
  • accessibility_compliance (bool):WCAG 2.1 AA合规性
  • archive_formats (列表):存档类型\[“zip”、“tar”、“tar.gz”\]

______________________________________________________________________

📁 项目结构

Document-Automation/
├── src/
│   ├── analyzers/           # Codebase analysis modules
│   │   ├── base_analyzer.py
│   │   ├── codebase_analyzer.py
│   │   ├── database_analyzer.py
│   │   ├── framework_detector.py
│   │   └── project_classifier.py
│   ├── diagrams/            # Diagram generation
│   │   ├── architecture_diagrams.py
│   │   ├── database_diagrams.py
│   │   └── mermaid_generator.py
│   ├── export/              # Format exporters
│   │   └── format_exporter.py
│   ├── generators/          # Documentation generators
│   │   ├── documentation_generator.py
│   │   ├── interactive_doc_generator.py
│   │   ├── professional_doc_generator.py
│   │   └── readme_template.py
│   ├── pagination/          # Pagination and chunking
│   │   ├── chunker.py
│   │   ├── context.py
│   │   ├── strategies.py
│   │   └── token_estimator.py
│   ├── parsers/             # Language parsers
│   │   ├── ast_analyzer.py
│   │   ├── javascript_parser.py
│   │   ├── python_parser.py
│   │   └── mcp_analyzer.py
│   ├── processing/          # Background processing
│   │   ├── background_processor.py
│   │   └── concurrent_analyzer.py
│   ├── security/            # Security features
│   │   ├── content_filter.py
│   │   └── validation.py
│   ├── tools/               # MCP tools
│   │   └── consolidated_documentation_tools.py
│   ├── schemas.py           # Data schemas
│   └── server.py            # MCP server
├── run_server.py            # Server entry point
├── requirements.txt         # Python dependencies
├── pyproject.toml          # Project metadata
└── README.md               # This file

______________________________________________________________________

🏗️ 建筑

系统概述

flowchart TB
    Client[Claude/MCP Client] --> Server[MCP Server]
    Server --> Analyzer[Codebase Analyzer]
    Server --> Generator[Doc Generator]
    Server --> Exporter[Format Exporter]
    
    Analyzer --> AST[AST Parser]
    Analyzer --> Framework[Framework Detector]
    Analyzer --> Database[DB Analyzer]
    Analyzer --> Security[Security Scanner]
    
    Generator --> Interactive[Interactive HTML]
    Generator --> Professional[Professional Docs]
    Generator --> Diagrams[Mermaid Diagrams]
    
    Exporter --> PDF[PDF Export]
    Exporter --> HTML[HTML Export]
    Exporter --> Markdown[Markdown Export]
    Exporter --> DOCX[DOCX Export]

组件交互

sequenceDiagram
    participant Client
    participant Server
    participant Analyzer
    participant Generator
    participant Exporter
    
    Client->>Server: analyze_codebase()
    Server->>Analyzer: Parse & Analyze
    Analyzer->>Analyzer: AST, Framework, DB, Security
    Analyzer-->>Server: Analysis Results
    Server-->>Client: analysis_id
    
    Client->>Server: generate_documentation()
    Server->>Generator: Create Docs
    Generator->>Generator: Format, Theme, Diagrams
    Generator-->>Server: Documentation
    Server-->>Client: Generated Files
    
    Client->>Server: export_documentation()
    Server->>Exporter: Convert Formats
    Exporter->>Exporter: PDF, HTML, DOCX
    Exporter-->>Server: Exported Files
    Server-->>Client: Export Results

______________________________________________________________________

🛠️ 发展

设置开发环境

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dev dependencies
pip install -r requirements.txt
pip install black pytest pytest-cov mypy

# Run tests
pytest tests/

# Format code
black src/

# Type checking
mypy src/

运行测试

# Run all tests
pytest

# Run with coverage
pytest --cov=src --cov-report=html

# Run specific test file
pytest tests/test_analyzer.py

代码质量

# Format with Black
black src/ tests/

# Lint with Flake8
flake8 src/ tests/

# Type check with MyPy
mypy src/

______________________________________________________________________

🤝 贡献

欢迎投稿!请遵循以下指南:

  1. 分叉存储库
  2. 创建要素分支: git checkout -b feature/amazing-feature
  3. 提交您的更改: git commit -m 'Add amazing feature'
  4. 推到分支: git push origin feature/amazing-feature
  5. 打开拉取请求

贡献指南

  • 遵循PEP 8风格指南
  • 为新功能添加测试
  • 更新文档
  • 确保所有测试通过
  • 保持提交原子性和良好的描述

______________________________________________________________________

📊 演出

基准测试

操作小型回购(\1000个文件
分析~5秒~30秒~2-5分钟
文档生成~2秒~10秒~30秒
导出(所有格式)~3秒~15秒~45秒

优化提示

  • 使用 pagination_strategy="smart" 对于大型存储库
  • 启用 include_security_analysis=False 如果不需要
  • 限制 max_files 为了更快的分析
  • 对多个项目使用并发处理

______________________________________________________________________

🐛 故障排除

常见问题

问题: ModuleNotFoundError: No module named 'src'

# Solution: Add project root to PYTHONPATH
export PYTHONPATH="${PYTHONPATH}:/path/to/Document-Automation"

问题:GitHub速率限制

# Solution: Set GitHub token
export GITHUB_TOKEN="your_token_here"

问题:大型存储库的内存错误

# Solution: Use pagination
analyze_codebase(path="...", max_files=500, pagination_strategy="smart")

______________________________________________________________________

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

______________________________________________________________________

🙏 致谢

______________________________________________________________________

📮 联系

Vedant Parmar - @韦丹塔马尔12

项目链接:

______________________________________________________________________

🗺️ 路线图

  • \[\]支持更多编程语言(Go、Rust、Java)
  • \[\]实时协作功能
  • \[\]云存储集成(S3、GCS)
  • \[\]根据OpenAPI规范自动生成API文档
  • \[\]使用CVE数据库增强安全扫描
  • \[\]性能分析和优化建议
  • \[\]自定义模板支持
  • \[\]独立使用的CLI工具

______________________________________________________________________

⭐ 明星历史

如果你觉得这个项目有用,请考虑给它一颗星! ⭐

______________________________________________________________________

由以下材料制成❤️ 韦丹特·帕马尔

目录标签

目录标签

代码分析安全PythonClaude本地部署文档生成多格式导出AI集成安全扫描

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP