Renders Mermaid diagram syntax to PNG or SVG images for LLM clients
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
An MCP server that renders Mermaid diagrams to PNG, SVG, or PDF β or converts them to editable draw.io files. Give your LLM the ability to turn diagram syntax into actual images and documents.
Add to claude_desktop_config.json:
Note: the first run downloads headless Chromium (~150 MB), so the initial startup takes a few minutes. If you only need flowcharts and can work with editable files, the
drawiofast path skips Chromium entirely.
No Node.js or Chromium download needed β the image ships with everything (including CJK fonts for Japanese/Chinese/Korean labels):
To use output_path, mount a host directory and write into it:
Then pass output_path: "/out/figure.pdf" and the file appears in C:\diagrams.
The same server speaks Streamable HTTP when PORT is set (or MCP_TRANSPORT=http), so it can be deployed to any container host β Railway, Fly.io, etc. β straight from the Dockerfile:
POST /mcp (health check at /healthz)AUTH_TOKEN to require Authorization: Bearer <token>output_path is disabled in HTTP mode; base64/XML responses onlyrender_diagram| Parameter | Type | Default | Description |
|---|---|---|---|
syntax | string | (required) | Mermaid diagram definition |
format | png | svg | pdf | drawio | png | Output format (drawio = editable draw.io XML, flowcharts only) |
theme | default | dark | neutral | forest | default | Visual theme |
background | string | white | CSS colour or transparent |
width | number | 1200 | Canvas width in px (PNG only) |
pdfFit | boolean | true | Scale the PDF page to fit the diagram (PDF only) |
output_path | string | β | Write the result to this file path instead of returning base64 |
Returns the rendered image as base64-encoded data so MCP clients can display it inline β or, with output_path, writes the file to disk (handy for PDFs destined for printing or formal document submission).
Ask your LLM:
"Draw me a flowchart of the OAuth login flow"
It generates the Mermaid syntax, calls render_diagram, and you get back a PNG.
drawio fast path (no Chromium)format: "drawio" is the one output that never touches a browser. It's pure JavaScript β parse, lay out with dagre, emit XML β so there's no Chromium download, no ~150 MB install, and no multi-minute first run. Conversion is effectively instant.
Reach for it when:
Open the result in draw.io (or the VS Code extension) and export to PNG/SVG/PDF from there if you do need an image β that's a complete Chromium-free round trip.
flowchart and graph diagrams convert; sequence, class, state, ER, and gantt throw an error. Use PNG/SVG/PDF for those.theme, background, and width are ignored. Styling is draw.io's job once the file is open.Supported syntax: directions TD / TB / BT / LR / RL; shapes [rect], (rounded), {rhombus}, ((circle)), ([stadium]), [[subroutine]], [(cylinder)], {{hexagon}}; edges -->, ---, -.->, ==>, <-->, each optionally carrying a |label|.
PNG, SVG, and PDF rendering shells out to @mermaid-js/mermaid-cli (bundled as a dependency), which uses a headless Chromium to render diagrams. First npm install downloads Chromium (~150 MB), so it takes a few minutes.
draw.io export is pure JavaScript β a flowchart parser plus dagre layout (the same engine Mermaid uses) emit native mxGraphModel XML, so every shape stays individually editable in draw.io.
mermaid-render-mcp)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/mermaid-render-mcp)<a href="https://allmcps.com/mcp/mermaid-render-mcp"><img src="https://allmcps.com/api/badge/mermaid-render-mcp?style=directory" alt="Mermaid Render MCP on AllMCPs" /></a>