The official draw.io MCP (Model Context Protocol) server that enables LLMs to open and create diagrams in the draw.io editor.
.claude-plugin/marketplace.json— Claude Code plugin marketplace manifest. Lists this repo's plugins (currently justdrawio, sourced from./plugins/claude-code); plugin metadata is inherited from each plugin's ownplugin.json. Users install with/plugin marketplace add jgraph/drawio-mcpthen/plugin install drawio@drawio..agents/plugins/marketplace.json— Codex CLI plugin marketplace manifest (Codex's format:sourceobject +policy+category). Lists thedrawioplugin sourced from./plugins/codex/drawio; metadata is inherited from that plugin's own.codex-plugin/plugin.json. Users install withcodex plugin marketplace add jgraph/drawio-mcpthencodex plugin add drawio@drawio.shared/— Shared XML generation reference (xml-reference.md), the single source of truth for all LLM prompts.mcp-app-server/— MCP App server (renders diagrams inline in chat via iframe). Hosted athttps://mcp.draw.io/mcp. Can also be self-hosted via Node.js or Cloudflare Workers.mcp-tool-server/— Original MCP tool server (stdio-based, opens browser). Published as@drawio/mcpon npm.project-instructions/— Claude Project instructions (no MCP required, no install).plugins/— Assistant-side plugins grouped by host, one subdirectory per AI assistant.plugins/claude-code/— Claude Code plugin: ships thedrawioskill (generates native.drawiofiles, authored as Mermaid — converted + laid out by the desktop CLI — or as XML directly with optional ELK--layout; exports to PNG/SVG/PDF, or opens as a browser URL viaapp.diagrams.net). Mermaid conversion, ELK layout, and image export need draw.io Desktop; plain XML.drawio/urloutput does not. Installable via the repo-root marketplace orclaude --plugin-dir ./plugins/claude-code. No MCP required.plugins/codex/drawio/— Codex CLI plugin: the Codex port of the Claude Code plugin, shipping the samedrawioskill.skills/drawio/SKILL.mdis byte-identical to the Claude plugin's copy (Codex uses the same/drawio:drawioinvocation and fetches the same shared references from GitHub). Differs only in host wrapping: a.codex-plugin/plugin.jsonmanifest with aninterfaceblock (official draw.io SVG logo,brandColor, default prompts). Nested undercodex/because Codex requires the plugin root folder name to equalplugin.json"name"(drawio). No MCP required.
shape-search/— Shape search index generator. Loads draw.io'sapp.min.jsvia jsdom to extract all shape styles and tags intosearch-index.json, which powers thesearch_shapesMCP tool. Re-run after updatingdrawio-devto pick up new or changed shapes.
Most subdirectories have their own CLAUDE.md with implementation details.
- Input:
{ xml: string }- draw.io XML in mxGraphModel format - Output: Interactive diagram rendered inline via the draw.io viewer library
- Features: Zoom, pan, layers, fullscreen, "Open in draw.io" button
- Input:
{ query: string, limit?: number }- Search keywords and optional max results (default: 10, max: 50) - Output: Array of matching shapes with
{style, w, h, title}— style strings can be used directly in mxCell attributes - Search: AND logic across space-separated terms, exact + Soundex phonetic matching
- Coverage: ~10,000+ shapes across all draw.io libraries (AWS, Azure, GCP, P&ID, electrical, Cisco, Kubernetes, UML, BPMN, etc.)
- Use case: Call before
create_diagramonly for diagrams needing industry-specific icons (cloud, network, P&ID, electrical, Cisco, Kubernetes). Skip for standard diagrams (flowcharts, UML, ERD, org charts) that use basic geometric shapes
Opens the draw.io editor with XML content.
Parameters:
content(required): Draw.io XML contentlightbox(optional): Open in read-only lightbox mode (default: false)dark(optional): Dark mode - "true" or "false" (default: false)routing(optional):"libavoid"runs a server-side obstacle-avoiding orthogonal edge-routing pass before opening — keeps vertex positions, reroutes connectors around shapes. Use for hand-placed diagrams where edges would otherwise cross boxes.
Example XML:
<mxGraphModel adaptiveColors="auto">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Hello" style="rounded=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="120" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>Opens the draw.io editor with CSV data that gets converted to a diagram.
Parameters:
content(required): CSV contentlightbox(optional): Open in read-only lightbox mode (default: false)dark(optional): Dark mode - "true" or "false" (default: false)
%column% placeholders in style attributes (like fillColor=%color%) - this can cause "URI malformed" errors.
Opens the draw.io editor with a Mermaid.js diagram definition.
Parameters:
content(required): Mermaid.js syntaxlightbox(optional): Open in read-only lightbox mode (default: false)dark(optional): Dark mode - "true" or "false" (default: false)
Searches the draw.io shape library by keywords (same tool as the app server's search_shapes, sharing shared/shape-search.js). The ~4.6 MB index is not bundled in the npm package — it is fetched from the CDN on first use (overridable via DRAWIO_SHAPE_INDEX_URL), or read locally in an in-repo checkout.
Parameters:
query(required): Space-separated search keywords (e.g.aws lambda,cisco router,kubernetes pod)limit(optional): Maximum results to return (default: 10, max: 50)
Output: Array of matching shapes with {style, w, h, title} — style strings can be used directly in mxCell style attributes. Use only for diagrams needing industry-specific icons; skip for standard flowcharts, UML, ERD, and org charts.
Page-level access to a local multi-page .drawio file, so a large file doesn't need to be loaded whole into context just to inspect or edit one page.
list_pages:{ path: string }→[{index, id, name, approxSizeBytes}]for every page, without decompressing page contentget_page:{ path: string, page: string }(pageis a zero-based index, exact page name, or page id) → rawmxGraphModelXML for that pageset_page:{ path: string, page: string, content: string }→ replaces that page's content with newmxGraphModelXML (a single<mxGraphModel>element, no<diagram>tags), leaving all other pages untouched
These are the only tools that read/write local files by path; paths must end in .drawio or .xml.
Use case: Call list_pages first on any large multi-page file to find the page you need by name/index/id, then get_page/set_page to work on just that page instead of the whole file.
| Need | Use | Reliability |
|---|---|---|
| Flowchart, sequence, ER diagram | open_drawio_mermaid |
High |
| Custom styling, precise positioning | open_drawio_xml |
High |
| Org chart from data | open_drawio_csv |
Medium |
Default to Mermaid — it handles most diagram types reliably.
- Default to Mermaid: It handles flowcharts, sequences, ER diagrams, Gantt charts, and more — all reliably
- Use XML for precision: When you need exact positioning, custom colors, or complex layouts
- Avoid CSV for critical diagrams: CSV processing can fail; prefer Mermaid for org charts when possible
- Validate syntax: Ensure Mermaid/CSV/XML syntax is correct before sending
- Return the URL to users: Always provide the generated URL so users can open the diagram in their browser
Two canonical reference files live in shared/ and feed every delivery mechanism (MCP App Server, MCP Tool Server, Claude Code Plugin, Project Instructions):
shared/xml-reference.md— draw.io XML generation reference: styles, edge routing, containers, layers, tags, metadata, dark mode, well-formedness rules. Consumed bycreate_diagram(mcp-app-server) andopen_drawio_xml(mcp-tool-server).shared/mermaid-reference.md— Mermaid syntax reference for all 26 supported diagram types (flowchart, sequence, class, state, ER, gantt, mindmap, timeline, quadrant, C4, architecture, radar, packet, venn, treemap, kanban, zenuml, …) plus flowchart styling (style,classDef,linkStyle). Consumed byopen_drawio_mermaid(mcp-tool-server).
The MCP servers read these files at startup and append them to the relevant tool description. The skill and project instructions reference them via GitHub URL.
When updating diagram-generation guidance, edit only these files — changes propagate to all consumers automatically.
- Allman brace style: Opening braces go on their own line for all control structures, functions, objects, and callbacks.
function example()
{
if (condition)
{
doSomething();
}
else
{
doOther();
}
}- Prefer
function()expressions over arrow functions for callbacks.
| Error | Cause | Solution |
|---|---|---|
| XML comments in output | <!-- --> comments found in generated XML |
Remove all XML comments — they are strictly forbidden |
| "URI malformed" | Special characters in CSV style attributes | Use hardcoded colors instead of %column% placeholders |
| "Service nicht verfügbar" | draw.io CSV server unavailable | Retry later or use Mermaid instead |
| Blank diagram | Invalid Mermaid/XML syntax | Check syntax, ensure proper escaping |
| Diagram doesn't match expected | Mermaid version differences | Simplify syntax, avoid edge cases |