Deploys the MCP server on Cloudflare's edge network for global distribution, leveraging Workers, D1 Database, R2 Storage, and Durable Objects
Extracts API endpoints and structure from Django web applications
Analyzes Express.js applications to document API endpoints and routes
Detects and documents API endpoints from FastAPI projects
Discovers and documents API endpoints from Flask applications
Integrates with Git repositories for project analysis and documentation generation
Allows analysis of GitHub repositories to extract project structure, dependencies, and codebase metrics
Discovers and documents API endpoints from Spring framework applications
Document Automation
A sophisticated Model Context Protocol (MCP) server that enables AI assistants to automatically analyze codebases and generate comprehensive, professional documentation.
Overview
Document Automation is an intelligent documentation generation system that bridges the gap between AI assistants and code documentation workflows. By implementing the Model Context Protocol (MCP), it allows AI assistants like Claude to seamlessly analyze project structures, extract insights, and generate professional-grade documentation automatically.
Key Features
Intelligent Codebase Analysis - Deep project structure and dependency analysis
Professional Documentation Generation - Multi-format output (Markdown, HTML, RST, PDF)
AI Assistant Integration - Native Claude Desktop and Cursor IDE support
Multi-Platform Deployment - Local, Docker, Google Cloud Run, and Cloudflare Workers
Advanced MCP Tools - 5 specialized analysis and generation tools
Security-First Design - Built-in validation and safety measures
Edge Computing Ready - Deployed globally via Cloudflare's edge network
Architecture
Quick Start
Prerequisites
Python 3.8+ (for local development)
Git
Claude Desktop or Cursor IDE (for AI integration)
Cloudflare Account (for deployment - free tier available)
Wrangler CLI (for Cloudflare deployment)
Installation
Basic Usage
Once installed, you can use the system through your AI assistant:
The system will automatically:
Analyze the project structure and dependencies
Extract key architectural insights
Generate professional documentation
Format the output in your preferred style
Deployment Options
Cloudflare Workers (Recommended for Production)
Prerequisites
Cloudflare Account - Sign up at dash.cloudflare.com
Wrangler CLI - Install with
npm install -g wrangler
Deployment Steps
Authenticate with Cloudflare:
Create required resources:
Configure wrangler.toml:
Enable required services in Cloudflare Dashboard:
Navigate to Workers & Pages to create workers.dev subdomain
Enable R2 storage service
Create R2 bucket named
mcp-documents
Deploy to Cloudflare:
Your MCP server will be available at:
Cloudflare Resources Used
Workers: Edge computing for MCP server
D1 Database: Stores analysis results and metadata
R2 Storage: Stores generated documentation
AI: Powers intelligent analysis features
Durable Objects: Maintains MCP session state
Local Development
Docker Deployment
Google Cloud Run
MCP Tools Reference
analyze_codebase
Performs comprehensive codebase analysis and structure extraction.
Parameters:
path
(string): Local folder path or GitHub repository URLsource_type
(enum):"local"
|"github"
include_dependencies
(boolean): Include dependency analysis (default: true)
Returns:
Project structure with file hierarchy
Dependencies and versions
Codebase metrics and statistics
Language distribution analysis
Example:
generate_documentation
Creates comprehensive documentation from analyzed codebase.
Parameters:
analysis_id
(string): ID from previous analyze_codebase callformat
(enum):"markdown"
|"html"
|"rst"
|"pdf"
(default: "markdown")include_api_docs
(boolean): Include API documentation (default: true)include_architecture
(boolean): Include architecture diagrams (default: true)include_examples
(boolean): Include code examples (default: true)
Returns:
Formatted documentation content
Generation metadata
Word count and statistics
list_project_structure
Provides detailed project structure with file information.
Parameters:
path
(string): Project pathsource_type
(enum):"local"
|"github"
max_depth
(integer): Maximum traversal depth (default: 5)
Returns:
Hierarchical file structure
File sizes and types
Last modification timestamps
extract_api_endpoints
Discovers and documents API endpoints from web frameworks.
Parameters:
path
(string): Project pathsource_type
(enum):"local"
|"github"
framework
(enum):"auto"
|"fastapi"
|"flask"
|"django"
|"express"
|"spring"
Returns:
List of discovered endpoints
HTTP methods and paths
Parameter documentation
analyze_dependencies
Analyzes project dependencies and generates dependency documentation.
Parameters:
path
(string): Project pathsource_type
(enum):"local"
|"github"
include_dev_dependencies
(boolean): Include development dependencies (default: false)
Returns:
Dependency list with versions
Security analysis
Update recommendations
Configuration
Claude Desktop Integration
Configure your
For Cloudflare deployment, use:
Restart Claude Desktop
Cursor IDE Integration
Update your MCP settings:
Follow the detailed setup guide in
Project Structure
Core Components
MCP Server Infrastructure
The server implementation spans multiple files including server.py
, main.py
, and index.ts
for Cloudflare Workers integration. This core infrastructure handles:
Tool registration and discovery
Request/response handling
Error management and validation
Async operation support
Cloudflare Workers integration
Analyzers Module
The analyzers directory contains two main components:
Base Analyzer (base_analyzer.py
) provides the foundation for all analysis operations with common patterns, utilities, and file system traversal capabilities.
Codebase Analyzer (codebase_analyzer.py
) specializes in project structure analysis, dependency extraction, language detection, and Git repository integration.
Documentation Generators
The generators module includes:
Standard Generator (documentation_generator.py
) for basic documentation generation with multiple output format support and template-based rendering.
Professional Generator (professional_doc_generator.py
) - the most comprehensive component in the project - handles advanced formatting, enterprise-grade documentation, and architecture diagram generation.
MCP Tools
The tools directory implements the MCP protocol:
Documentation Tools (documentation_tools.py
) contains all MCP tool implementations with parameter validation and response formatting.
Tool Registration (register_tools.py
) manages dynamic tool discovery and maintains MCP protocol compliance.
Security Layer
The Validation Module (validation.py
) ensures input sanitization, prevents path traversal attacks, and enforces security policies throughout the system.
Type System
The types.py
file defines Pydantic data models, request/response schemas, and enforces type safety across the application.
Dependencies
Core Framework Dependencies
mcp - Model Context Protocol implementation
fastapi - Modern async web framework
uvicorn[standard] - ASGI server with standard extensions
pydantic - Data validation and serialization
Documentation & Template Engine
jinja2 - Template engine for documentation generation
markdown - Markdown processing and rendering
pygments - Syntax highlighting for code blocks
File & Data Processing
aiofiles - Async file operations
toml - TOML configuration file parsing
PyYAML - YAML file processing
python-dotenv - Environment variable management
External Communication
httpx - Modern async HTTP client
requests - Traditional HTTP library for compatibility
gitpython - Git repository analysis and manipulation
Development Support
typing-extensions - Extended type hints for better IDE support
Cloudflare Dependencies
wrangler - Cloudflare Workers CLI
@cloudflare/workers-types - TypeScript types for Workers
@cloudflare/ai - Cloudflare AI integration
Total Dependencies: 15 production packages + Cloudflare tools
Usage Examples
Basic Codebase Analysis
Ask your AI assistant:
This triggers:
analyze_codebase tool call
Automatic structure analysis
Dependency extraction
Metrics calculation
Generate Documentation
Ask your AI assistant:
This triggers:
generate_documentation tool call
Professional formatting
Multiple output formats
Architecture diagrams
API Endpoint Discovery
Ask your AI assistant:
This triggers:
extract_api_endpoints tool call
Framework detection
Endpoint documentation
Parameter extraction
Development & Testing
Testing Framework
Unit Tests: tests/test_analyzer.py
Integration Tests: test_mcp.py, test_mcp_simple.py
Configuration: tests/conftest.py
Running Tests
Development Setup
Performance & Scalability
Cloudflare Edge Deployment Benefits
Global Distribution: Deployed to 300+ edge locations worldwide
Low Latency: Sub-50ms response times globally
Auto-scaling: Handles millions of requests without configuration
DDoS Protection: Built-in enterprise-grade protection
Zero Cold Starts: Always-warm edge computing
Resource Limits (Cloudflare Free Tier)
100,000 requests/day
10ms CPU time per request
1MB request/response size
Unlimited bandwidth
Project Metrics
Total Files: 134
Total Lines of Code: Over 13,000
Python Files: 20 core functionality files
Documentation Files: 13 comprehensive markdown guides
Configuration Files: Multiple JSON, YAML, and TOML files
Core Components Distribution
Primary implementation in Python for analysis and generation
TypeScript for Cloudflare Worker integration
Comprehensive documentation suite
Multiple deployment configurations
Automated setup scripts for different platforms
The Professional Documentation Generator represents the most extensive component, containing over 1,200 lines of sophisticated formatting and visualization logic.
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature
)Commit your changes (
git commit -m 'Add some amazing feature'
)Push to the branch (
git push origin feature/amazing-feature
)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For questions, issues, or feature requests:
Open an issue on GitHub
Check the documentation in the
docs/
folderReview the setup guides for your specific use case
Acknowledgments
Built on the Model Context Protocol (MCP)
Integrates with Claude and Cursor IDE
Deployed on Cloudflare Workers
Uses modern Python async frameworks for optimal performance
Leverages Cloudflare's global edge network for worldwide availability
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A sophisticated server that enables AI assistants to automatically analyze codebases and generate comprehensive, professional documentation.
Related MCP Servers
- -securityFlicense-qualityA smart documentation server that provides AI-assisted code improvement and documentation management through Claude Desktop integration.Last updated -10
JSON Resume MCP Serverofficial
AsecurityAlicenseAqualityA server that enhances AI assistants with the ability to update your JSON Resume by analyzing your coding projects, automatically extracting skills and generating professional descriptions.Last updated -2257The Unlicense- -securityAlicense-qualityA server that enables AI assistants like Claude to safely run Python code and access websites, processing data for better AI understanding while providing helpful error messages.Last updated -3GPL 3.0
- -securityFlicense-qualityA local server that provides powerful code analysis and search capabilities for software projects, helping AI assistants and development tools understand codebases for tasks like code generation and refactoring.Last updated -4