A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"mermaid-mcp-server": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images or SVG files. This server allows AI assistants and other applications to generate visual diagrams from textual descriptions using the Mermaid markdown syntax.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in design / developer-tools
Manage Supabase projects — databases, auth, storage, and edge functions
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
MCP server for using the GitLab API
MCP Security Weekly
Get CVE alerts and security updates for Mermaid Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images or SVG files. This server allows AI assistants and other applications to generate visual diagrams from textual descriptions using the Mermaid markdown syntax.
The server uses Puppeteer to launch a headless browser, render the Mermaid diagram to SVG, and optionally capture a screenshot of the rendered diagram. The process involves:
npx tsc
{
"mcpServers": {
"mermaid": {
"command": "npx",
"args": ["-y", "@peng-shawn/mermaid-mcp-server"]
}
}
}
env CONTENT_IMAGE_SUPPORTED=false npx -y @peng-shawn/mermaid-mcp-server
You can find a list of mermaid diagrams under ./diagrams, they are created using Cursor agent with prompt: "generate mermaid diagrams and save them in a separate diagrams folder explaining how renderMermaidPng work"
Run the server with inspector for testing and debugging:
npx @modelcontextprotocol/inspector node dist/index.js
The server will start and listen on stdio for MCP protocol messages.
Learn more about inspector here.
To install Mermaid Diagram Generator for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @peng-shawn/mermaid-mcp-server --client claude
When running in Docker containers (including via Smithery), you may need to handle Chrome dependencies:
The server now attempts to use Puppeteer's bundled browser by default
If you encounter browser-related errors, you have two options:
Option 1: During Docker image build:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true when installing PuppeteerPUPPETEER_EXECUTABLE_PATH at runtime to point to the Chrome installationOption 2: Use Puppeteer's bundled Chrome:
PUPPETEER_SKIP_CHROMIUM_DOWNLOADFor Smithery users, the latest version should work without additional configuration.
The server exposes a single tool:
generate: Converts Mermaid diagram code to a PNG image or SVG file
code: The Mermaid diagram code to rendertheme: (optional) Theme for the diagram. Options: "default", "forest", "dark", "neutral"backgroundColor: (optional) Background color for the diagram, e.g. 'white', 'transparent', '#F0F0F0'outputFormat: (optional) Output format for the diagram. Options: "png", "svg" (defaults to "png")name: Name for the generated file (required when CONTENT_IMAGE_SUPPORTED=false)folder: Absolute path to save the image/SVG to (required when CONTENT_IMAGE_SUPPORTED=false)The behavior of the generate tool depends on the CONTENT_IMAGE_SUPPORTED environment variable:
CONTENT_IMAGE_SUPPORTED=true (default): The tool retur