Mermaid MCP Server
Provides access to Mermaid diagram syntax documentation and validation tools, enabling search through official syntax docs for various diagram types (flowchart, sequence, class, C4, etc.) and validation of Mermaid diagram code before rendering.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mermaid MCP Serversearch for flowchart syntax with subgraphs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mermaid MCP Server
Model Context Protocol server that bundles the official Mermaid syntax docs and a syntax validator so agents can search, quote, and check diagrams before sending them to users.
What It Does
Serves Mermaid syntax Markdown as MCP resources (flowchart, sequence, class, C4, etc.) plus a
guideprompt for quick routing.search_mermaid_docsfinds sections in the bundled docs (mermaid/docs/syntax) with optional diagram filtering and snippet/full modes. Results come from a startup cache for speed.validate_mermaidrunsmermaid.parseto flag syntax issues; DOM-related errors are treated as pass-through so headless environments still work.
Related MCP server: Mermaid Lint MCP
Architecture
flowchart TD
Client[MCP client] -->|stdio| StdioTransport
Client -->|HTTP /mcp| HttpTransport
StdioTransport --> Server
HttpTransport --> Server
Server[Mermaid MCP server] -->|registers| Resources[Docs resources + guide prompt]
Server -->|tools| Tools
Tools --> Search[search_mermaid_docs -> cached syntax md]
Tools --> Validate[validate_mermaid -> mermaid.parse]
Search --> DocsCache[Docs cache: mermaid/docs/syntax]
Validate --> MermaidLib[Mermaid parser]Install & Run
Clone (includes Mermaid submodule):
git clone --recurse-submodules <repo-url>or, if already cloned:
git submodule update --init --recursive
Prereq: Node 18+
Install:
npm installBuild:
npm run buildStart (STDIO for MCP clients):
npm run start:stdioStart (HTTP for testing):
npm run start:http(health at/health, MCP endpoint at/mcp)
MCP Client Wiring (STDIO)
{
"mcpServers": {
"mermaid": {
"command": "node",
"args": ["/absolute/path/to/mcp-mermaid/dist/server.js"]
}
}
}Agent Usage Tips
Always search first:
search_mermaid_docswith a single-term query (e.g.,flowchart,subgraph,arrow); usediagram_typeto narrow by file;mode: "full"returns entire docs.Always validate after editing:
validate_mermaidon the final diagram string.Use the
guideprompt for quick diagram-type routing and common pitfalls.
Tests
Run unit tests:
npm test
Project Layout
src/server.ts– MCP server, resources, tools, docs cachesrc/httpServer.ts– Express HTTP wrapper for/mcpguides/–guide.mdprompt and configmermaid/docs/syntax/– Bundled official Mermaid syntax Markdowndist/– Built JS output
Request Flow (User → Answer)
sequenceDiagram
participant U as User
participant A as MCP Client/Agent
participant S as Mermaid MCP Server
participant Docs as Docs Cache (mermaid/docs/syntax)
participant V as validate_mermaid (mermaid.parse)
U->>A: Ask for Mermaid help
A->>S: search_mermaid_docs {query}
S-->>Docs: Read cached syntax
Docs-->>S: Return snippets/full sections
S-->>A: Matched reference sections
A->>S: validate_mermaid {code}
S->>V: Parse diagram
V-->>S: Valid / warnings / error
S-->>A: Validation result
A-->>U: Deliver answer + validated diagramThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityAmaintenanceValidates Mermaid diagrams with comprehensive grammar parsing supporting 28+ diagram types. Processes markdown files, ZIP archives, and direct input with detailed error reporting and enterprise-grade performance capabilities.692Apache 2.0
- AlicenseBqualityDmaintenanceA tool for validating Mermaid diagram syntax through CLI and MCP interfaces, providing real-time error checking and line-specific feedback. It enables AI assistants to self-validate and debug generated diagrams across all Mermaid types, ensuring valid visual documentation.192MIT
- Flicense-qualityDmaintenanceEnables the dynamic generation of various software development diagrams, such as flowcharts, sequence diagrams, and architecture diagrams, using Mermaid syntax. It includes tools for diagram validation and provides instructions for exporting results to multiple formats including SVG and PNG.
- Alicense-qualityDmaintenanceProvides MCP tools to validate Mermaid diagram syntax, render diagrams to SVG, and get documentation links.9816MIT
Related MCP Connectors
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
Let Claude, Cursor, or ChatGPT author Mermaid diagrams your team can read and share.
Generate cloud architecture diagrams, flowcharts, and sequence diagrams.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ziangziangziang/mcp-mermaid'
If you have feedback or need assistance with the MCP directory API, please join our Discord server