drawio-mcp
Creates and opens diagrams in draw.io (diagrams.net) from XML, Mermaid, or CSV input.
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., "@drawio-mcpcreate a mermaid flowchart for user authentication"
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.
drawio-mcp
An MCP (Model Context Protocol) server that enables LLMs to create and open diagrams in draw.io. Supports native draw.io XML, Mermaid.js syntax, and CSV data formats.
When an LLM calls one of the tools, the server compresses the diagram content, builds a draw.io URL with the #create hash parameter, and opens it in your default browser — the diagram appears instantly in the draw.io editor, ready to edit and export.
Tools
Tool | Format | Best for |
| draw.io XML | Full control over styling and layout |
| Mermaid.js | Quick flowcharts, sequence diagrams, ER diagrams |
| CSV | Org charts and diagrams from tabular data |
Related MCP server: fcp-drawio
Installation
git clone https://github.com/mingrath/drawio-mcp.git
cd drawio-mcp
npm install
npm run buildOr install globally:
npm install -g drawio-mcpConfiguration
Claude Code
Add to your ~/.claude/settings.json:
{
"mcpServers": {
"drawio-mcp": {
"command": "node",
"args": ["/absolute/path/to/drawio-mcp/dist/index.js"]
}
}
}Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"drawio-mcp": {
"command": "node",
"args": ["/absolute/path/to/drawio-mcp/dist/index.js"]
}
}
}Usage Examples
XML — Custom styled diagram
<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Service A" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="140" height="60" as="geometry"/>
</mxCell>
<mxCell id="3" value="Service B" style="rounded=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="320" y="100" width="140" height="60" as="geometry"/>
</mxCell>
<mxCell id="4" style="endArrow=block;endFill=1;" edge="1" source="2" target="3" parent="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>Mermaid — Flowchart
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[End]
D --> EMermaid — Sequence diagram
sequenceDiagram
participant Client
participant API
participant DB
Client->>API: POST /users
API->>DB: INSERT user
DB-->>API: OK
API-->>Client: 201 CreatedCSV — Org chart
# label: %name%
# style: whiteSpace=wrap;html=1;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;
# connect: {"from":"manager","to":"name","invert":true,"style":"endArrow=blockThin;endFill=1;"}
# layout: auto
name,manager
CEO,
CTO,CEO
CFO,CEO
VP Engineering,CTO
VP Product,CTOTool parameters
All three tools accept these optional parameters:
Parameter | Type | Default | Description |
| string | (required) | Diagram content or a URL pointing to content |
| boolean |
| Open in read-only lightbox mode |
|
|
| Dark mode setting |
How It Works
The LLM calls a tool with diagram content (XML, Mermaid, or CSV).
The server URI-encodes and deflate-compresses the content.
A draw.io URL is constructed with the compressed data in a
#create=hash fragment.The URL opens in your default browser — draw.io reads the hash and renders the diagram.
Because the data lives in the URL hash fragment, it is never sent to any server.
Development
npm run dev # Watch mode — recompiles on changes
npm run build # One-time build
npm start # Run the compiled serverRequirements
Node.js >= 18
A browser (for opening diagrams)
License
MIT - Mingrath Mekavichai
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
- Alicense-qualityDmaintenanceAn MCP server that enables AI assistants to programmatically create and manage flowcharts, ERDs, and swimlane diagrams. It provides tools for manipulating diagram structures, performing auto-layouts, and exporting to Mermaid or Markdown formats.Last updated20MIT
- AlicenseBqualityBmaintenanceMCP server that enables LLMs to create and edit draw.io diagrams using high-level intent commands, with automatic layout and styling.Last updated4123MIT
- AlicenseAqualityAmaintenanceMCP server for creating and editing diagrams using draw.io. Allows generating diagrams from Mermaid or XML, searching shapes, and opening them in draw.io for export.Last updated20Apache 2.0
- Flicense-qualityDmaintenanceEnables AI agents to create, modify, and analyze diagrams using Draw.io (Diagrams.net) through MCP commands.Last updated
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for Flux AI image generation
MCP server for Google Veo AI video generation
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/mingrath/drawio-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server