Draw.io MCP Server
This server lets AI agents create, inspect, and modify Draw.io diagrams through MCP.
Retrieve the selected cell and inspect paginated diagram cells with filters.
Add rectangles, library shapes, and edges between cells.
Edit vertex/shape properties, edge properties, and named shapes.
Set custom data attributes and delete cells by ID.
Discover shape categories and shapes by category or name.
README also advertises document/page/layer management, multi-document targeting, Mermaid import/expand, XML/SVG/PNG import/export, TLS, a built-in editor, and browser-extension support.
Enables programmatic control of Draw.io diagrams through MCP commands, allowing AI agents to create, modify, and analyze diagram content including architectural diagrams, flowcharts, process maps, and visual relationships.
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., "@Draw.io MCP Server create a simple flowchart for 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
Let's do some Vibe Diagramming with the most wide-spread diagramming tool called Draw.io (Diagrams.net).
Key Highlights
Browser extension UI and documentation localized to Simplified Chinese (zh-CN)
Claude Code plugin:
/plugin marketplace add lgazo/drawio-mcp-serverthen/plugin install drawio, with/drawio-openand/drawio-statusslash commandsnpx drawio-mcp-server install <host>writes the MCP config forclaude-code,claude-desktop,codex,zed,opencode, orallDocument persistence tools:
set-document-titleandsave-documentDraw.io library API version compatibility mechanism
Enable Draw.io MCP in IFrames
AWS, GCP, Azure, Cisco19, and CiscoSafe stencils auto-discovered at runtime from drawio's sidebar
Multi-document targeting with
list-documentsandtarget_documentselectors for multi-tab workflowsMulti-page targeting with required
target_pageselectors for page-scoped toolsPer-document FIFO serialization for live operations, so multiple agents can work on different files safely
Page management tools:
list-pages,get-current-page,create-page,copy-page,rename-pageImport, embed, or expand Mermaid diagrams
Firefox support is back, TLS mode is necessary
Server supports TLS mode and optionally generates self-signed certificates
Import and export diagrams from/to XML, SVG (with embedded XML), or PNG (with embedded XML)
Edge geometry control with waypoints and automatic self-connector routing
Parent-child relationships for nested shapes and grouping
Unified Server and Extension in the same mono-repo
Built-in Draw.io editor - no browser extension required
MCP server that lets AI agents control Draw.io diagrams
Programmatic diagram creation, inspection, and modification via MCP tools
Layer management for complex diagrams
Works with any MCP client (Claude Desktop, Claude Code, Zed, Codex, etc.)
Related MCP server: Draw.io MCP Server
Introduction
The Draw.io MCP server brings Draw.io diagramming capabilities to AI agents. It provides MCP tools that can create, read, update, and delete diagram elements - letting AI assistants build architectural diagrams, flowcharts, and visual documentation automatically.
Two ways to use:
Built-in editor - Server hosts Draw.io directly, accessible in your browser
Browser extension - Connect to Draw.io running in your browser via extension
Experimental: integration with the draw.io desktop (Electron) app is in progress but currently blocked by an upstream CSP issue — see DESKTOP.md.
Requirements
Node.js (v22 or higher; tested against v22 LTS and v24 LTS) - Runtime environment for the MCP server
MCP client - Claude Desktop, Claude Code, Zed, Codex, OpenCode, or any MCP-compatible host
For Built-in Editor
No additional requirements - runs out of the box with --editor flag.
For Browser Extension
Browser extension - drawio-mcp-extension
Draw.io open in your browser
Optional
pnpm - Preferred package manager (npm works fine too)
Quick Start
1. Configure your MCP host
Fastest path:
Claude Code:
/plugin marketplace add lgazo/drawio-mcp-serverthen/plugin install drawio.Any other host:
npx drawio-mcp-server install <host>where<host>isclaude-code,claude-desktop,codex,zed,opencode, orall.
See docs/PLUGINS.md for the full reference, flags, and uninstall, and docs/release.md for how releases are cut.
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["-y", "drawio-mcp-server", "--editor"]
}
}
}For other MCP clients and detailed configuration (including pnpm options), see Configuration.
2. Open the editor
After restarting your MCP host, open: http://localhost:3000/
3. Start diagramming
Example prompts you can try:
"Create an event-driven architecture diagram showing a message queue with producers, consumers, and three backend services"
"Create a three-page event-driven architecture diagram. Use three agents in parallel for service topology, message flow, and retry/failure handling, with each agent assigned to a separate target page."
"Draw a CRUD API diagram with a database, API gateway, and four microservices with their endpoints"
"Add a new layer called 'Background' and move all decorative elements to it, then create a new layer for annotations"
Your AI assistant can now control the diagram using MCP tools.
Features
The server provides MCP tools for:
Document discovery - list connected Draw.io document instances and route later calls to a specific tab/file instance
Diagram inspection - read shapes, pages, layers, and cell properties
Diagram modification - add/edit/delete shapes, edges, and labels on a target page
Page management - list pages, inspect the current page, create pages, copy pages, and rename pages without forcing a visible page switch on supported runtimes
Layer management - create, switch, and organize layers
Vendor shape coverage - AWS, GCP, Azure, Cisco19, and CiscoSafe stencils auto-discovered at runtime from drawio's sidebar, so agents can place icons like
mxgraph.gcp2.cloud_runormxgraph.cisco19.routerwithout hand-curated catalogsBuilt-in TLS — opt-in HTTPS + WSS with manual cert/key or auto-generated self-signed material via a per-user local CA. See CONFIG.md → TLS.
See Tools Reference for the complete list of available tools.
MCP Apps support
On MCP Apps-capable hosts (Claude Desktop, QuixiDesk, MCPJam, VS Code Copilot), the show-diagram tool opens the diagram as an interactive draw.io editor directly inside the conversation. The framed editor displays the diagram, connects to the server's WebSocket bridge, and registers there as a live document: it appears in list-documents (in embed mode) and agent tool calls (e.g. add-rectangle) apply to it, verified in headless E2E. Syncing user-side edits made in the framed editor so the agent sees them remains pending real-browser verification.
Enable it by running the server with the --editor flag; no other configuration is needed. On hosts without MCP Apps support, show-diagram falls back to returning plain diagram XML text.
Limitation: the MCP host must be able to reach http://localhost:<http-port>, where the locally served draw.io editor is framed. Native desktop hosts like Claude Desktop work; remote browser sessions may not be able to.
See the show-diagram tool for details.
Installation
The server runs as part of your MCP host. Detailed configuration for all supported clients (Claude Desktop, Claude Code, Zed, Codex, oterm) including npm and pnpm options is available in Configuration.
Alternative: Browser Extension
Instead of the built-in editor, you can use the browser extension to connect to Draw.io running in your browser. This works with or without the --editor flag.
Install the Draw.io MCP Browser Extension:
Ensure the extension is connected (green signal overlay on icon)
Configuration without --editor:
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["-y", "drawio-mcp-server"]
}
}
}See the extension documentation for more details.
Experimental: Draw.io Desktop
Integration with the draw.io desktop (Electron) app is experimental and currently blocked end-to-end by an upstream CSP issue. The plugin loads inside draw.io desktop, but its WebSocket connection back to the MCP server is rejected by draw.io's hard-coded connect-src 'self' policy.
See DESKTOP.md for the full setup steps and the current limitation.
Related Resources
Configuration - CLI flags and advanced options
Tools Reference - Complete MCP tools documentation
Draw.io Desktop (experimental) - install path and known CSP limitation
Star History
Assessments

Available Tools
13 toolsadd-cell-of-shapeC
This tool allows you to add new vertex cell (object) on the current page of a Draw.io diagram by its shape name. It accepts multiple optional input parameter.
Inputs: shape_name (required), x, y, width, +3 more.
add-edgeC
This tool creates an edge, sometimes called also a relation, between two vertexes (cells).
Inputs: source_id (required), target_id (required), text, style.
add-rectangleC
This tool allows you to add new Rectangle vertex cell (object) on the current page of a Draw.io diagram. It accepts multiple optional input parameter.
Inputs: x, y, width, height, +2 more.
delete-cell-by-idC
Deletes a cell, whether it is a vertex or edge.
Inputs: cell_id (required).
edit-cellA
Update properties of an existing vertex/shape cell by its ID. Only provided fields are modified; unspecified properties remain unchanged.
Inputs: cell_id (required), text, x, y, +3 more.
edit-edgeA
Update properties of an existing edge by its ID. Only provided fields are modified; unspecified properties remain unchanged.
Inputs: cell_id (required), text, source_id, target_id, +1 more.
get-selected-cellB
This tool allows you to retrieve selected cell (whether vertex or edge) on the current page of a Draw.io diagram. The response is a JSON containing attributes of the cell.
Inputs: no named parameters.
get-shape-by-nameA
Retrieve a specific shape by its name from all available shapes in the diagram's library. It returns the shape and also the category it belongs.
Inputs: shape_name (required).
get-shape-categoriesB
Retrieves available shape categories from the diagram's library. Library is split into multiple categories.
Inputs: no named parameters.
get-shapes-in-categoryC
Retrieve all shapes in the provided category from the diagram's library. A shape primarily contains style based on which you can create new vertex cells.
Inputs: category_id (required).
list-paged-modelA
Retrieves a paginated view of all cells (vertices and edges) in the current Draw.io diagram. This tool provides access to the complete model data with essential fields only, sanitized to remove circular dependencies and excessive data. It allows to filter based on multiple criteria and attribute boolean logic. Useful for programmatic inspection of diagram structure without overwhelming response sizes.
Inputs: page, page_size, filter.
set-cell-dataC
Sets or updates a custom attribute on an existing cell.
Inputs: cell_id (required), key (required), value (required).
set-cell-shapeC
Updates the visual style of an existing vertex cell to match a library shape by name.
Inputs: cell_id (required), shape_name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
The tools have clear purposes but some overlap exists, such as add-cell-of-shape and add-rectangle both adding vertex cells, which could cause confusion. However, descriptions help differentiate them by shape specificity, and most tools target distinct actions like editing, deleting, or retrieving cells.
Tool names follow a consistent verb_noun pattern with minor deviations, such as list-paged-model using 'paged' instead of a direct noun. Most names are clear and readable, like delete-cell-by-id and get-shape-by-name, maintaining a predictable structure throughout the set.
With 13 tools, the count is well-scoped for a diagram editing server, covering essential operations like adding, editing, deleting, and retrieving cells and shapes. Each tool earns its place by addressing specific needs in diagram manipulation without being overwhelming.
The toolset provides comprehensive coverage for diagram editing, including CRUD operations for cells and edges, shape management, and data inspection. Minor gaps exist, such as no direct tool for creating new pages or handling diagram-level properties, but agents can work around these with existing tools.
Maintenance
Related MCP Connectors
Draw architecture diagrams, UML, planning boards and clickable wireframes from your AI assistant.
Create draw.io diagrams in chat from Mermaid or XML, shown live and interactive. 10,000+ shapes.
Create and edit architecture diagrams from your AI agent; get an SVG and a live editable canvas.
Create, edit and organize hand-drawn diagrams (flowcharts, ER, architecture) from any AI agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to create and edit draw.io diagrams programmatically, supporting a wide range of diagram types and styles.72 PyPI6MIT
- AlicenseCqualityDmaintenanceEnables AI models to create and manage various types of diagrams (flowcharts, UML, network diagrams, etc.) via the Model Context Protocol.266MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create, modify, and analyze diagrams using Draw.io (Diagrams.net) through MCP commands.MIT
- FlicenseNot gradedqualityFmaintenanceEnables AI assistants to create, read, and manage Draw.io diagrams programmatically through natural language interactions.1-