mermaid-mcp — one MCP server to diagram any project (Local/GitHub → Mermaid → PNG)
Mermaid MCP Server is an MCP server that helps agents turn large codebases (local folders or GitHub repositories) into Mermaid diagrams and render them as PNG images via Kroki, enabling fast, reliable understanding of a project’s structure and flow.
Why this server
When working with a new codebase, it’s easy to lose time jumping between folders and files. This server provides a clean, tool-based workflow for agents to discover, read, and visualize a project — without guessing paths or inventing structure.
Key features
- Local + GitHub sources: analyze either a local project folder or a remote repository.
- Agent-friendly pipeline:
list_files→read_file→ generate Mermaid →render_mermaid. - Safe local access boundary: local reads are restricted to
PROJECT_ROOT. - Configurable limits: control max file size (
MAX_FILE_CHARS) and output directory (DIAGRAM_OUT_DIR). - Portable output: rendered diagrams are returned as image content and also saved as PNG files.






