What is McpDoc?
McpDoc is a Model Context Protocol (MCP) server implementation that generates documentation for existing systems. It provides MCP prompts and tools for creating code summaries and C4 architecture diagrams using Mermaid.js, intended for developers working with legacy or large codebases.
How to use McpDoc?
Use the provided prompts with an MCP client (such as an MCP-capable IDE) and the MCP filesystem tool. The prompts direct the model to walk the directory tree, generate summary README.C4Diagrammer.md files per source directory, create C4Component diagrams alongside them, and finally produce C4Context and C4Container rollup diagrams at the root.
Key features of McpDoc
- README generation for each source code directory
- C4Component diagram generation per source directory
- Rollup C4Context and C4Container diagrams at the root
- Mermaid.js diagram validation and improvement tools
- Browser-based preview of generated diagrams
- Timestamp-based regeneration to avoid unnecessary work
Use cases of McpDoc
- Onboarding new developers to complex, unfamiliar codebases
- Navigating and understanding legacy systems with minimal prior knowledge
- Creating lightweight, living architecture documentation that evolves with the code
- Providing high-level overviews for stakeholders and non-technical team members
- Helping developers identify where to safely make changes in a large system
Comments