diagram-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@diagram-mcp Render a flowchart showing signup -> verify -> welcome as a PNG"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
diagram-mcp
MCP server that renders diagram-as-code text to PNG files on your disk. No browser, no network, no external service. Useful for generating flowcharts to drop into docs, tickets or READMEs.

Tools
render_diagram: code to a PNG, returns the file pathpreview_diagram: draws the diagram as text art, straight into the conversation, writes no filevalidate_diagram: parse and report errors with line numbers, writes nothingdiagram_syntax: the language reference
Related MCP server: mermaid-mcp
Install
Requires Node 20.12+.
git clone https://github.com/JVmano/diagram-mcp.git
cd diagram-mcp
npm install
npm run buildThen register it with Claude Code:
claude mcp add diagram --scope user \
--env DIAGRAM_MCP_OUTPUT_DIR=$HOME/Documents/diagram-renders \
-- node "$(pwd)/dist/index.js"Or add it by hand to .mcp.json / your user config:
{
"mcpServers": {
"diagram": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/diagram-mcp/dist/index.js"],
"env": { "DIAGRAM_MCP_OUTPUT_DIR": "/absolute/path/to/renders" }
}
}
}Restart the session, then ask for a diagram. Run npm run build again after pulling changes.
Language
title "Reward approval flow"
direction TB
node event "Conversion recorded" shape=rounded
node auto "Auto-approve?" shape=diamond size=200x100
node queue "Manual review queue"
event -> auto
auto -> queue "no"Shapes: rect, rounded, ellipse, diamond, hexagon. Connections: from -> to ["label"] [style=solid|dashed]. Positions with at=x,y are optional. Leave them out and the layout places the shapes. Call diagram_syntax for the full reference.
Config
All optional, all with defaults. See .env.example. Renders go to DIAGRAM_MCP_OUTPUT_DIR (default ~/Documents/diagram-renders). An explicit outputPath must stay inside that directory or the working directory unless DIAGRAM_MCP_ALLOW_ANY_OUTPUT_PATH=true.
Development
npm test # unit tests
npm run test:e2e # builds, then drives the server over stdio
npm run verify # typecheck, test, build, e2eThe parser, layout and SVG generation in src/core are shared with a local diagram editor project; npm run check:sync diffs them against it when it is checked out next door.
License
MIT
Available Tools
4 toolsdiagram_syntaxDiagram language referenceARead-onlyIdempotent
Return the full diagram-as-code language reference, with shapes, options and a worked example.
Inputs: no named parameters.
preview_diagramPreview diagram as textARead-onlyIdempotent
Draw the diagram as text art so it can be shown directly in the conversation. Writes no file. Use render_diagram when a PNG is needed.
Inputs: code (required), maxCols.
render_diagramRender diagram to PNGA
Render diagram-as-code text to a PNG file and return the path. Runs locally with no browser and no network. Returns an error listing the offending line numbers if the code does not parse.
Inputs: code (required), name, scale, padding, +3 more.
validate_diagramValidate diagram codeARead-onlyIdempotent
Parse diagram code and report errors and warnings with line numbers, without writing any file.
Inputs: code (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: syntax reference, validation, text preview, and PNG rendering. The descriptions clearly differentiate the outputs, and render_diagram explicitly notes when to use it over preview_diagram.
Three tools follow the verb_diagram pattern (render_diagram, validate_diagram, preview_diagram), while diagram_syntax reverses the order. The convention is still readable and consistent in style, with only a minor deviation.
Four tools is well-scoped for a diagram-as-code server. Each tool covers a necessary part of the workflow without redundancy or unnecessary bulk.
The toolset covers the full authoring loop: learn the syntax, validate the code, preview as text, and render to a PNG file. There are no obvious missing operations for the stated local rendering purpose.
Related MCP Connectors
Render, validate, encode/decode PlantUML diagram-as-code; 22 diagram types. Free, no auth.
Draws UI wireframes from a small text language: multi-screen boards with notes and flow arrows.
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
Diagrams, badges, charts and QR codes as plain image URLs you can paste into Markdown.
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts Markdown files into professional diagrams such as flowcharts, mind maps, and architecture diagrams using Mermaid.js and custom SVG renderers. It enables users to list, render, and export visualizations in multiple formats including SVG, PNG, and PDF.3MIT
- AlicenseAqualityDmaintenanceRenders Mermaid diagram markup to PNG images using Puppeteer/Chromium. Enables AI-generated diagrams to be previewed inline and saved to disk.113 npmMIT
- FlicenseAqualityCmaintenanceEnables local creation and maintenance of editable draw.io XML diagram files, with tools for inspecting, validating, and updating diagrams.5-
- FlicenseBqualityCmaintenanceEnables creating and maintaining technical diagrams from .dot sources, with validation, rendering to SVG/PNG/PDF, and publishing into Markdown while automatically partitioning oversized graphs.6-