Draw.io MCP Server
The official draw.io MCP (Model Context Protocol) server that enables LLMs to create and open diagrams in the draw.io editor.
Four Ways to Create Diagrams
This repository offers four approaches for integrating draw.io with AI assistants. Pick the one that fits your setup:
| MCP App Server | MCP Tool Server | Claude Code Plugin | Project Instructions |
|---|
| How it works | Renders diagrams inline in chat | Opens diagrams in your browser | Generates .drawio files, optional PNG/SVG/PDF export or browser URL | Claude generates draw.io URLs via Python |
| Diagram output | Interactive viewer embedded in conversation | draw.io editor in a new tab | .drawio, .drawio.png / .svg / .pdf, or browser URL | Clickable link to draw.io |
| Requires installation | No (hosted at mcp.draw.io) | Yes (npm package) | One-line plugin install (draw.io Desktop only for PNG/SVG/PDF export) | No — just paste instructions |
| Supports XML, CSV, Mermaid | XML only | ✅ All three | XML only (native format) | ✅ All three |
| Editable in draw.io | Via "Open in draw.io" button | ✅ Directly | ✅ Directly | Via link |
| Works with | Claude.ai, VS Code, any MCP Apps host | Claude Desktop, any MCP client | Claude Code | Claude.ai (with Projects) |
| Best for | Inline previews in chat | Local desktop workflows | Local development workflows | Quick setup, no install needed |
MCP App Server
The MCP App server renders draw.io diagrams inline in AI chat interfaces using the MCP Apps protocol. Instead of opening a browser tab, diagrams appear directly in the conversation as interactive iframes.
The official hosted endpoint is available at:
https://mcp.draw.io/mcp
Add this URL as a remote MCP server in Claude.ai or any MCP Apps-compatible host — no installation required.
You can also run the server locally via Node.js or deploy your own instance to Cloudflare Workers.
Tools:
create_diagram — Renders draw.io XML as an interactive diagram inline in chat
search_shapes — Searches 10,000+ shapes across all draw.io libraries (AWS, Azure, GCP, P&ID, electrical, Cisco, Kubernetes, UML, BPMN, etc.) by keyword. Returns exact style strings that can be used directly in XML. Use this to find the correct shape before calling create_diagram.
Full documentation →
Note: Inline diagram rendering requires an MCP host that supports the MCP Apps extension. In hosts without MCP Apps support, the tool still works but returns the XML as text.
MCP Tool Server
The original MCP server that opens diagrams directly in the draw.io editor. Supports XML, CSV, and Mermaid.js formats with lightbox and dark mode options. Published as @drawio/mcp on npm.
Quick start: npx @drawio/mcp
Full documentation →
Claude Code Plugin
A Claude Code plugin (under plugins/claude-code/) that generates native .drawio files, with optional export to PNG, SVG, or PDF (with embedded XML so the exported file remains editable in draw.io) — or a browser URL that opens the diagram directly in app.diagrams.net. No MCP setup required.
Install from this repo's marketplace inside Claude Code:
/plugin marketplace add jgraph/drawio-mcp
/plugin install drawio@drawio
Or load it directly from a local clone with claude --plugin-dir ./plugins/claude-code.
By default, the plugin writes a .drawio file and opens it in draw.io. Mention a format in your request to change the output:
/drawio:drawio png ... / svg / pdf — exports using the draw.io desktop CLI with --embed-diagram
/drawio:drawio url ... — compresses the XML with Node.js's built-in zlib and opens the result at app.diagrams.net. No draw.io Desktop needed; the .drawio file is kept locally as a persistent copy.
Full documentation →
Alternative: Project Instructions (No MCP Required)
An alternative approach that works without installing anything. Add instructions to a Claude Project that teach Claude to generate draw.io URLs using Python code execution. No MCP server, no desktop app — just paste and go.
Full documentation →
Diagram layouts
Two optional, independent layout passes can run after the AI generates a diagram — one re-arranges the nodes, the other only reroutes the edges. Which are available depends on the approach: