
Mermaid Render Mcp
io.github.tci-nebulaPublished by GitHub account tci-nebulav1.3.0Updated Oct 24, 2026
Renders Mermaid diagram syntax to PNG or SVG images for LLM clients
Overview
A local MCP server that renders Mermaid diagram syntax into PNG, SVG or PDF images, or converts flowcharts into editable draw.io files.
- What you can do
- Render Mermaid diagram definitions into PNG, SVG or PDF images returned inline as base64 or written to a file path you specify, with theme, background, width and PDF-fit options. Convert flowchart and graph syntax into editable draw.io XML without a browser, for diagrams you want to keep editing.
- When to use it
- Useful when you want an assistant to turn a described process, architecture or flow into an actual image or document, or into an editable draw.io file. The draw.io path suits constrained machines where downloading Chromium is impractical.
- Requirements
- Local process run via npx, so Node.js 18+ is needed. PNG, SVG and PDF rendering downloads headless Chromium (~150 MB) on first run, which takes a few minutes; the draw.io path skips it. A Docker image is offered as an alternative. No accounts or API keys are declared.
Installation
In SourceWeft
- Open Mermaid Render Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mermaid-mcp
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.
Quick start
Claude Code
Claude Desktop
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.
Docker
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.
Remote / self-hosted (HTTP)
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:
- Endpoint:
POST /mcp(health check at/healthz) - Set
AUTH_TOKENto requireAuthorization: Bearer <token> output_pathis disabled in HTTP mode; base64/XML responses only
From source
Tool: render_diagram
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).
Example
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.
The 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:
- you want the diagram editable rather than flat — every shape stays a real draw.io object
- you're on a constrained box (CI, a slim container, a locked-down laptop) where downloading Chromium isn't practical
- you just want the diagram now and don't need a raster image
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.
Limits
- Flowcharts only.
flowchartandgraphdiagrams convert; sequence, class, state, ER, and gantt throw an error. Use PNG/SVG/PDF for those. theme,background, andwidthare ignored. Styling is draw.io's job once the file is open.- Node sizes are estimated from label length, not measured font metrics. draw.io re-measures text when it opens the file so boxes settle correctly — but treat the raw XML geometry as approximate.
Supported syntax: directions TD / TB / BT / LR / RL; shapes [rect], (rounded), {rhombus}, ((circle)), ([stadium]), [[subroutine]], [(cylinder)], {{hexagon}}; edges -->, ---, -.->, ==>, <-->, each optionally carrying a |label|.
How it works
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.
Requirements
- Node.js 18+
Roadmap
- PDF export (formal/legal document workflows)
- draw.io XML export (editable diagrams — flowcharts)
- npm package (
mermaid-render-mcp) - Remote-hosted server option (Streamable HTTP transport)
License
Source: README.md at commit 64adfc2
Tools
0Version history
1- v1.3.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts