Draw.io MCP Server
OfficialThe shape search tool can find Cisco shapes among 10,000+ draw.io library shapes.
Allows self-hosting the MCP App server, which renders draw.io diagrams inline in AI chat interfaces, on Cloudflare Workers.
The primary integration target - a draw.io MCP server that creates, opens, and renders diagrams in the draw.io editor, supporting XML, CSV, and Mermaid formats with various layout and export options.
Provides a draw.io skill as a plugin for GitHub Copilot CLI, generating native .drawio diagram files with optional export to PNG, SVG, PDF, or browser URL.
The shape search tool can find Kubernetes shapes among 10,000+ draw.io library shapes.
Supports creating diagrams in Mermaid.js format in addition to native draw.io XML, which can be opened in the draw.io editor.
Supports exporting diagrams to SVG format with embedded XML so exported files remain editable in draw.io.
The shape search tool can find UML shapes among 10,000+ draw.io library shapes.
The native diagram format supported across all approaches, rendered inline in chat or opened in the draw.io editor.
Click on "Install 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., "@Draw.io MCP ServerCreate a flowchart diagram showing the user login process"
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.
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:
How it works | Renders diagrams inline in chat | Opens diagrams in your browser | Generates | Claude generates draw.io URLs via Python |
Diagram output | Interactive viewer embedded in conversation | draw.io editor in a new tab |
| Clickable link to draw.io |
Requires installation | No (hosted at | 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, Cursor, any MCP Apps host | Claude Desktop, Cursor, any MCP client | Claude Code, Codex CLI, GitHub Copilot | Claude.ai (with Projects) |
Best for | Inline previews in chat | Local desktop workflows | Local development workflows | Quick setup, no install needed |
Related MCP server: Draw.io MCP Server
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/mcpAdd this URL as a remote MCP server in Claude.ai, Cursor, or any MCP Apps-compatible host — no installation required. In Cursor (≥ 2.6), diagrams render inline in the Agent chat (one-click install); on older builds, use the stdio @drawio/mcp tool server instead.
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 chatsearch_shapes— Searches 10,000+ shapes across all draw.io libraries (AWS, Azure, GCP, P&ID, electrical, Cisco, Kubernetes, UML, BPMN, etc.) by keyword, supplemented by the draw.io icon service (brand logos and general-purpose concept icons) when the built-in libraries have no good match. Returns exact style strings that can be used directly in XML. Use this to find the correct shape before callingcreate_diagram.
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
Setup instructions are available for Claude Desktop, Claude Code, VS Code (GitHub Copilot), and Cursor (with one-click install).
Assistant Plugins (Claude Code, Codex CLI, GitHub Copilot)
The drawio skill packaged as a plugin for AI coding assistants (under plugins/): it 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. The same skill ships for three hosts:
Claude Code (full documentation →) — install from this repo's marketplace:
/plugin marketplace add jgraph/drawio-mcp
/plugin install drawio@drawioOr load it directly from a local clone with claude --plugin-dir ./plugins/claude-code.
Codex CLI (full documentation →) — install from the same marketplace repo:
codex plugin marketplace add jgraph/drawio-mcp
codex plugin add drawio@drawioGitHub Copilot CLI (full documentation →) — install from the same marketplace repo:
copilot plugin marketplace add jgraph/drawio-mcp
copilot plugin install drawio@drawioOther Copilot surfaces (VS Code agent mode, the coding agent, code review) load the same skill from a repo's .github/skills/ directory instead — see the plugin README.
By default, the plugin writes a .drawio file and opens it in draw.io. Mention a format in your request to change the output:
png / svg / pdf — exports using the draw.io desktop CLI with
--embed-diagramurl — compresses the XML with Node.js's built-in
zliband opens the result atapp.diagrams.net. No draw.io Desktop needed; the.drawiofile is kept locally as a persistent copy.
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.
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:
Layout pass | What it does | App Server ( | Tool Server ( | Assistant Plugins | Project Instructions |
ELK auto-layout ( | Re-arranges nodes into a clean layered layout; routes the edges as part of it | ✅ | — | ✅ via draw.io Desktop CLI ( | — |
libavoid routing ( | Keeps node positions; reroutes connectors orthogonally around the shapes | ✅ | ✅ from v1.3.0 | ✅ via draw.io Desktop CLI ( | — |
These apply to draw.io XML diagrams. Mermaid diagrams are auto-laid-out already, so neither pass is needed.
The App Server applies these in the inline viewer after the diagram renders; the Tool Server applies libavoid server-side before opening the draw.io editor; the plugins run them through the locally installed draw.io Desktop CLI.
Pick one, not both: ELK already routes its own edges, so adding libavoid on top is redundant. Use
postLayoutto re-arrange a layout, orroutingto tidy the connectors on a layout you placed deliberately.
Data Residency & Offline Use
If you're deploying in an environment with strict data restrictions, here is exactly where diagram data goes for each approach.
No component sends your diagram to a cloud rasterizer. convert.diagrams.net (or
any cloud export endpoint) is not called anywhere in this repository, and there is no
"local dependency missing → fall back to cloud" path. PNG/SVG/PDF export happens only
in the assistant plugins, which shell out to your locally installed draw.io Desktop CLI
(located via which drawio); if it isn't installed, the .drawio file is kept and
nothing is sent.
Does your diagram leave the machine?
Approach | Diagram leaves the machine? |
MCP App Server — hosted ( | Yes — it is sent to the draw.io server as the MCP request. Self-host instead (below) to keep it local. |
MCP App Server — self-hosted (local Node or your own Cloudflare) | No — processed by your server and embedded in HTML that renders client-side. |
MCP Tool Server ( | No — carried in the URL |
Assistant Plugins (Claude Code, Codex CLI, GitHub Copilot) | No — written locally and exported by your local draw.io Desktop CLI. |
By default the servers do not write diagram content to their logs — only request
metadata (method, session, status, timing). The Cloudflare-hosted App Server logs
response bodies only when run with DEBUG=true.
Reducing external requests
Even when the diagram itself stays local, the rendering loads draw.io's web-app /
viewer code from app.diagrams.net and viewer.diagrams.net by default. These
fetch application code and assets — not your diagram — but they are still outbound
requests. To reduce or remove them:
App Server: build with the
VIEWER_PATHenvironment variable to inline the viewer instead of loading it fromviewer.diagrams.net.Tool Server: set the
DRAWIO_BASE_URLenvironment variable to a self-hosted draw.io instance.Assistant Plugins: the opt-in
urloutput mode opens the diagram atapp.diagrams.net(hardcoded — noDRAWIO_BASE_URLequivalent). Use the default.drawiooutput or local Desktop export instead if you need to avoid that request.
Your LLM is a separate consideration
The diagram is generated by the LLM. If you use a hosted model, the diagram content is produced in that provider's cloud regardless of where this MCP server runs. End-to-end isolation requires a locally hosted model as well.
Verifying
The only reliable way to confirm a deployment makes no outbound calls is to run it with network egress blocked (or watch the browser's Network tab) and verify it still renders. We recommend this for any strict-isolation deployment.
XML Reference (Single Source of Truth)
The draw.io XML generation reference — covering edge routing, containers, layers, tags, metadata, dark mode, style properties, and XML well-formedness — lives in a single canonical file:
All four approaches above use this file as their single source of truth for LLM prompts:
Approach | How it accesses the reference |
MCP App Server | Reads the file at startup / build time and includes it in the tool description |
MCP Tool Server | Reads the file at startup (from repo or bundled copy via |
Assistant Plugins (Claude Code, Codex CLI, GitHub Copilot) | Reference the GitHub raw URL |
Project Instructions | Users copy its contents into their Claude Project |
When updating XML generation guidance, edit only shared/xml-reference.md — changes propagate to all consumers automatically.
Shape Search Index
The search_shapes tool is powered by a pre-built index of all draw.io shapes. The index is generated from the live draw.io client (https://app.diagrams.net/js/app.min.js) by running all sidebar palette initializations in Node.js via jsdom and capturing the shape data.
Icons from the draw.io icon service (icons.diagrams.net — the same grouped icon search the editor sidebar uses) are not part of this index: search_shapes queries the service live when the local index has no strong match for a query, returning the icons as shape=image styles. Set DRAWIO_ICON_SERVICE_URL to a self-hosted service to override the endpoint, or to off to disable icon supplementation.
shape-search/search-index.json is committed to the repository and is automatically refreshed on every draw.io release via the Update Shape Search Index GitHub Action — no manual step is required to stay in sync with the latest shapes.
To regenerate the index manually (e.g. when iterating on the generator itself):
cd shape-search
npm install
npm run generate
# Rebuild the MCP App Server worker to embed the updated index
cd ../mcp-app-server
npm run build:workerThe generator fetches app.min.js directly from the public draw.io web app, so no local checkout of the draw.io source is needed.
Development
# MCP App Server
cd mcp-app-server
npm install
npm start
# MCP Tool Server
cd mcp-tool-server
npm install
npm startRelated Resources
draw.io - Free online diagram editor
draw.io Desktop - Desktop application
@drawio/mcp on npm - This package on npm
drawio-mcp on GitHub - Source code repository
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables AI agents to programmatically create, modify, and analyze Draw.io diagrams through the Model Context Protocol. Supports generating architectural diagrams, flowcharts, and visualizations with bidirectional communication between AI systems and Draw.io.Last updated131121,397MIT
- Alicense-qualityCmaintenanceEnables AI assistants to create and edit draw.io diagrams programmatically, supporting a wide range of diagram types and styles.Last updated5MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables LLMs to create and open diagrams in draw.io using XML, Mermaid, or CSV formats, by building a URL with compressed content and opening it in the browser.Last updated3112MIT
- Flicense-qualityDmaintenanceEnables AI agents to create, modify, and analyze diagrams using Draw.io (Diagrams.net) through MCP commands.Last updated
Related MCP Connectors
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
AI agent draws editable hand-drawn diagrams (flowchart, ER, architecture) via MCP, not static images
Generate cloud architecture diagrams, flowcharts, and sequence diagrams.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jgraph/drawio-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server