MCP server that diagrams local or GitHub projects as Mermaid PNGs rendered via Kroki.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Mermaid MCP Server.
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.
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.
list_files β read_file β generate Mermaid β render_mermaid.PROJECT_ROOT.MAX_FILE_CHARS) and output directory (DIAGRAM_OUT_DIR).| Tool | Description |
|---|---|
list_files | List files from a local folder or a GitHub repo (supports root + glob filtering). |
read_file | Read file contents (local or GitHub) with a configurable max length. |
render_mermaid | Render Mermaid text via Kroki and return ImageContent (also saves to disk). |
list_filesReturns a list of files for a given source (local / github) with root + glob filtering.
source: "local" or "github"root: default "."glob: default "**/*"repo_url: required when source="github"ref: default "main"recursive: default trueread_fileReads file contents (local or GitHub) with a length limit.
source: "local" or "github"path: requiredrepo_url: required when source="github"ref: default "main"max_chars: default MAX_FILE_CHARSrender_mermaidAccepts Mermaid text, renders it to a PNG via Kroki, returns ImageContent, and saves the file to disk.
mermaid: required (string) β the Mermaid diagram source texttitle: optional (string) β used to derive the output filename (will be sanitized)ImageContent containing the rendered PNG bytesPROJECT_ROOT/DIAGRAM_OUT_DIR/<filename>.pngmermaid is empty β errorDIAGRAM_OUT_DIR (inside PROJECT_ROOT)PROJECT_ROOT/DIAGRAM_OUT_DIR/<filename>.png (default output dir: ./diagrams/).title (sanitized to be filesystem-safe). If title is missing, a default name is used.<filename>.png already exists, it is overwritten.github source)For architecture details, see: ARCHITECTURE.md
Build and run with Docker (example):
This installs runtime dependencies and development extras (tests).
You can set env vars in your shell OR in the MCP client config that launches the server.
| Variable | Description | Used by |
|---|---|---|
PROJECT_ROOT | Local project root that the server is allowed to access (security boundary) | local_source |
KROKI_BASE_URL | e.g. https://kroki.io | render_mermaid |
KROKI_TIMEOUT | Kroki request timeout | render_mermaid |
DIAGRAM_OUT_DIR | Where to save PNGs (must be inside PROJECT_ROOT) | render_mermaid |
MAX_FILE_CHARS | Max characters to read from a file (prevents huge reads) | read_file |
| Variable | Description | Used by |
|---|---|---|
HTTP_VERIFY | Verify SSL certificates (as needed) | server |
GITHUB_TOKEN | Recommended to avoid GitHub rate limits; if set, adds an Authorization header | src/clients/github/client.py |
Example (Windows)
Example (macOS / Linux)
mermaid-mcpAny MCP client that can launch a local stdio server can use this project. Below is an example configuration for Claude Desktop.
Claude Desktop stores MCP server definitions in a JSON config file.
Common locations:
%APPDATA%\Claude\claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.jsonIf the file doesnβt exist yet, create it.
claude_desktop_config.jsonExample (Windows):
After saving the config file, fully close Claude Desktop and reopen it so the server is loaded.
Open Claude Desktop and check that the server tools appear (e.g. list_files, read_file, render_mermaid).
This project includes a canonical system prompt used to generate Mermaid diagrams in a consistent, tool-driven way. The prompt is registered on the MCP server under the name generate_mermaid_canonical and is defined in src/prompts/mermaid_prompt.py.
Two common ways to use it:
Client-supported prompts (recommended): If your MCP client supports server-side prompts, select the server mermaid-mcp, pick the prompt named generate_mermaid_canonical from the prompt list, and run it as the agent's system/instruction before invoking the tools. Using the server-registered prompt ensures agents always get the latest prompt text.
Copy & paste: If your client does not support server-side prompts, open src/prompts/mermaid_prompt.py, copy the prompt text, and paste it into the agent's system message or save it locally as a preset. Keep in mind you will need to update your local copy when the repository prompt changes.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/gittyburstein-mermaid-mcp-server)<a href="https://allmcps.com/mcp/gittyburstein-mermaid-mcp-server"><img src="https://allmcps.com/api/badge/gittyburstein-mermaid-mcp-server?style=directory" alt="Mermaid MCP Server on AllMCPs" /></a>