Mermaid MCP Server is an MCP server that converts textual Mermaid diagram code into PNG images or SVG files. It connects AI assistants and developer tools to a headless Chromium browser powered by Puppeteer, which executes the Mermaid.js rendering engine directly. Software developers, system architects, and technical writers use it to generate visual architecture diagrams, flowcharts, sequence diagrams, and class structures straight from conversational prompts. The server exposes a dedicated generate tool that lets users customize rendering parameters including color themes, background colors, and output formats. It supports returning rendered assets inline to supported clients or writing image files directly to the local filesystem when working in client environments that lack inline image preview support. By delegating chart layout and graphical rendering to a local headless environment, Mermaid MCP Server enables AI coding agents to produce clean, reproducible technical illustrations on demand.
Category: Design, Media & Creative
Tags: diagrams, mermaid, png, svg, visualization
json { "mcpServers": { "mermaid": { "command": "npx", "args": ["-y", "@peng-shawn/mermaid-mcp-server"] } } } 2. To install automatically in Claude Desktop using Smithery, run: bash npx -y @smithery/cli install @peng-shawn/mermaid-mcp-server --client claude 3. For clients that do not support inline images such as Cursor or Cline, set CONTENT_IMAGE_SUPPORTED=false and run: bash env CONTENT_IMAGE_SUPPORTED=false npx -y @peng-shawn/mermaid-mcp-server 4. For manual debugging with the MCP inspector, execute: bash npx @modelcontextprotocol/inspector node dist/index.jsPart of MCP Servers
Mermaid MCP Server converts Mermaid markdown syntax into rendered PNG or SVG diagram files. It uses a headless Puppeteer browser to render diagrams, letting you customize themes, set background colors, and either stream images back into chat responses or save files directly to designated folders on your local disk.
The server works with Claude Desktop, Cursor, Cline, and any other client supporting the Model Context Protocol. When using clients like Cursor that lack inline image rendering, you can set the CONTENT_IMAGE_SUPPORTED environment variable to false to write generated diagrams directly to disk.
You can add Mermaid MCP Server to Claude Desktop by registering an npx entry pointing to @peng-shawn/mermaid-mcp-server. Alternatively, install it automatically via Smithery CLI using the command npx -y @smithery/cli install @peng-shawn/mermaid-mcp-server --client claude.
While Claude Desktop includes built-in diagram capabilities, Mermaid MCP Server provides programmatic control over diagram themes such as neutral, dark, and forest, supports custom background colors, and exports standalone SVG or PNG files across various MCP-compatible clients.
Yes, Mermaid MCP Server is open source and distributed under the MIT license on GitHub.