Mermaid MCP Server
@peng-shawn
About Mermaid MCP Server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mermaid-mcp-server": {
"command": "npx",
"args": [
"tsc"
]
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is Mermaid MCP Server?
Mermaid MCP Server converts Mermaid diagram code into PNG images or SVG files. It uses Puppeteer for headless browser rendering and implements the Model Context Protocol (MCP) so AI assistants and other applications can generate visual diagrams from textual descriptions.
How to use Mermaid MCP Server?
Run the server with npx -y @peng-shawn/mermaid-mcp-server. Configure it as an MCP tool in Claude Desktop, Cursor, or Cline using the provided JSON entries. The server exposes a single generate tool that accepts parameters code, theme, backgroundColor, outputFormat, name, and folder. Set the environment variable CONTENT_IMAGE_SUPPORTED to true (default) for inline images or false to save to disk.
Key features of Mermaid MCP Server
- Converts Mermaid code to PNG or SVG
- Supports four diagram themes: default, forest, dark, neutral
- Customizable background colors
- Uses Puppeteer for high‑quality rendering
- Implements MCP protocol for seamless AI integration
- Returns images inline or saves them to disk
Use cases of Mermaid MCP Server
- Generate flowcharts, sequence diagrams, and class diagrams in AI assistants
- Create diagrams with specific themes and background colors
- Save diagram files to disk when inline images are not supported (e.g., Cursor)
- Automate diagram generation in MCP‑compatible tools
FAQ from Mermaid MCP Server
Does Claude desktop already support Mermaid via canvas?
Yes, but it does not support the theme and backgroundColor options. A dedicated server makes it easier to create Mermaid diagrams with different MCP clients.
Why do I need to set CONTENT_IMAGE_SUPPORTED=false when using with Cursor?
Cursor does not support inline images in responses yet. Setting the variable to false saves the diagram to disk and returns the file path.
What are the runtime dependencies?
The server requires Node.js (to run the npx command) and relies on Puppeteer’s bundled Chromium or a system‑installed Chrome/Chromium for headless rendering.
How are generated images returned or stored?
When CONTENT_IMAGE_SUPPORTED=true (default), the image or SVG is returned inline in the MCP response. When false, the file is saved to the specified folder and the file path is returned.
Which transport does the server use?
The server communicates over stdio using the MCP protocol. It can be tested and debugged with the MCP Inspector (npx @modelcontextprotocol/inspector).
Frequently asked questions
Does Claude desktop already support Mermaid via canvas?
Yes, but it does not support the `theme` and `backgroundColor` options. A dedicated server makes it easier to create Mermaid diagrams with different MCP clients.
Why do I need to set `CONTENT_IMAGE_SUPPORTED=false` when using with Cursor?
Cursor does not support inline images in responses yet. Setting the variable to `false` saves the diagram to disk and returns the file path.
What are the runtime dependencies?
The server requires Node.js (to run the npx command) and relies on Puppeteer’s bundled Chromium or a system‑installed Chrome/Chromium for headless rendering.
How are generated images returned or stored?
When `CONTENT_IMAGE_SUPPORTED=true` (default), the image or SVG is returned inline in the MCP response. When `false`, the file is saved to the specified folder and the file path is returned.
Which transport does the server use?
The server communicates over stdio using the MCP protocol. It can be tested and debugged with the MCP Inspector (`npx @modelcontextprotocol/inspector`).
Basic information
More Other MCP servers
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale

Glasswarp
GlasswarpSee and control a real Windows PC you own — from any MCP client, locally or remotely. Observe (UIA + screenshots), click/type/drag/scroll, launch apps, owner Live View. BYOH: your machine, your key.
Codelf
unbugA search tool helps dev to solve the naming things problem.
Nginx UI
0xJackyYet another WebUI for Nginx
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
Comments