GittyBurstein/mermaid-mcp-server
The GittyBurstein/mermaid-mcp-server is a self-hosted MCP (Model Context Protocol) server that enables AI agents, such as those in IDEs or chat interfaces, to automatically generate visual diagrams from code repositories. By connecting to a local project directory or a GitHub repository, the server analyzes the codebase structure and relationships, then produces Mermaid diagram syntax representing architecture, class hierarchies, or flowcharts. It leverages the Kroki rendering service to convert these textual descriptions into high-quality image outputs (PNG, SVG) directly within the agent conversation. Built in Python, the server exposes a set of MCP tools that can be invoked by any compatible client. It supports two primary modes: scanning a local filesystem path to build a diagram of the project, or fetching and analyzing a remote GitHub repository. The generated diagrams help developers quickly understand unfamiliar codebases, document system architecture, or explain relationships during code reviews. The server can be installed via pip or run inside a Docker container, making it portable across environments. The integration with Kroki ensures that diagrams are rendered without relying on local installations of Mermaid CLI or other heavy dependencies. Users can configure the server via environment variables to specify Kroki server URLs, GitHub tokens for private repos, and output formats. The tool is designed with extensibility in mind, allowing community contributions to add new diagram types or analysis heuristics.
- Category
- Developer Tools
- Pricing
- Open Source
Problem solved
Developers often struggle to visualize the structure of complex codebases, especially when onboarding to new projects or reviewing pull requests. Manually creating diagrams is time-consuming and often becomes outdated. This tool automates the generation of up-to-date diagrams directly from the code, enabling AI agents to instantly provide visual context, bridging the gap between textual code and graphical understanding.
Use cases
- An AI coding assistant generates a class diagram of a Python project to explain module dependencies.
- During code review, the server creates a flowchart of a new feature's logic from the pull request diff.
- A developer exploring an open-source GitHub repository asks the agent for an architecture diagram, and the server creates one from the code.
- Documenting a microservices project by generating sequence diagrams from code annotations or file structure.
- Educational contexts: students getting automatic visual feedback on their project structure.
Audience
- Developers
Pros
- Automates diagram generation from code, saving manual effort.
- Integrates with MCP ecosystem, allowing AI agents to use it seamlessly.
- Supports both local and remote repositories.
- Renders via Kroki, eliminating the need for local diagramming tools.
- Lightweight and open-source.
Cons
- Limited to Mermaid diagrams; may not support other formats.
- Dependent on Kroki service availability unless self-hosted.
- Currently early-stage with limited documentation and community.
Official website: https://github.com/GittyBurstein/mermaid-mcp-server
Canonical LambdaBase page: https://www.lambdabase.com/tools/gittyburstein-mermaid-mcp-server