A Claude Code plugin that generates native .drawio files. Claude authors each diagram as Mermaid (converted to editable draw.io shapes and laid out by the draw.io desktop CLI or, without it, by draw.io's converter in a headless Chrome, Edge or Chromium) or as draw.io XML directly — with optional ELK auto-layout for XML, export to PNG/SVG/PDF (with embedded XML so the file remains editable in draw.io), or a browser URL that opens the diagram directly in app.diagrams.net.
Since 1.2.3 the plugin also bundles the hosted draw.io MCP server (https://mcp.draw.io/mcp, in .mcp.json). Where Claude shows apps in the chat, such as Claude.ai, diagrams then render inline as interactive draw.io diagrams; in Claude Code's terminal the skill keeps writing files, as before. See Data for what that server receives. The server's tools come with it: once the hosted server lists create_semantic_diagram, the fast mode for flowcharts and swimlane diagrams that the model uses only when you ask for a quick or cheap diagram (details), it appears without a plugin update. The skill itself still points to create_diagram.
When you ask Claude Code to create a diagram, it will:
- Choose how to author it — Mermaid for standard types (flowchart, sequence, class, state, ER, gantt, mindmap…), or draw.io XML for custom styling, precise positioning, specific shape libraries, or when nothing can convert Mermaid
- Produce a native
.drawiofile — convert the Mermaid with the desktop CLI (without it, with the bundledscripts/mermaid-to-drawio.js), or write the XML directly (optionally running an ELK--layoutstep so you don't hand-place cells) - Handle the requested output:
- PNG / SVG / PDF — export using the draw.io desktop CLI
url— compress the XML with Node.js's built-inzliband openhttps://app.diagrams.net/#R...in your browser (keeps the.drawiofile as a local copy)- (default) — leave the
.drawiofile as-is
- Open the result
- Claude Code installed
- draw.io Desktop installed — required for ELK layout and PNG/SVG/PDF export. Not needed for
.drawioorurloutput: without it, Mermaid is converted in an installed Chrome, Edge or Chromium (or opened as a link that draw.io converts in the browser), and XML needs nothing, which Claude can produce with no desktop app
Inside Claude Code, add this repository as a plugin marketplace, then install:
/plugin marketplace add jgraph/drawio-mcp
/plugin install drawio@drawio
The marketplace manifest lives at .claude-plugin/marketplace.json at the repo root and points at this directory.
Claude Code keeps the version you installed until you update it. Refresh the marketplace, update the plugin, then restart Claude Code:
claude plugin marketplace update drawio
claude plugin update drawio@drawioTo load the plugin directly from a local clone (e.g. while iterating on the skill):
claude --plugin-dir ./plugins/claude-codeThe plugin loads the drawio skill from skills/drawio/SKILL.md — nothing else needs to be copied into your ~/.claude/skills/ directory.
In most cases you don't type a command at all — just ask Claude Code for a diagram ("draw a flowchart for user login") and the skill triggers automatically from its description. To invoke it explicitly, Claude Code namespaces plugin skills as /<plugin>:<skill>, so the command is /drawio:drawio:
/drawio:drawio create a flowchart for user login
(The first drawio is the plugin name, the second is the skill folder. Any skills added to this plugin later — e.g. /drawio:search-shapes — share the same prefix.)
By default, this writes a .drawio file and opens it in draw.io. To export to an image format or open the diagram in the browser, mention the format in your request:
/drawio:drawio png flowchart for user login → login-flow.drawio.png
/drawio:drawio svg: ER diagram for e-commerce → er-diagram.drawio.svg
/drawio:drawio pdf architecture overview → architecture-overview.drawio.pdf
/drawio:drawio url flowchart for user login → opens app.diagrams.net in browser, keeps login-flow.drawio locally
More examples:
/drawio:drawio sequence diagram for API auth
/drawio:drawio png class diagram for the models in src/
/drawio:drawio url architecture overview
| Format | Output | Editor | Dependency |
|---|---|---|---|
| (default) | .drawio file |
draw.io Desktop, or the browser app | None |
png |
.drawio.png (embedded XML) |
draw.io Desktop, or any viewer | draw.io Desktop (for export) |
svg |
.drawio.svg (embedded XML) |
draw.io Desktop, or any viewer | draw.io Desktop (for export) |
pdf |
.drawio.pdf (embedded XML) |
draw.io Desktop, or any PDF viewer | draw.io Desktop (for export) |
url |
Browser tab at app.diagrams.net + .drawio file kept locally |
draw.io editor in browser | Node.js (bundled with Claude Code) |
The .drawio.* double extension signals that the file contains embedded diagram XML. Open any of these in draw.io to recover and edit the full diagram. The intermediate .drawio source file is deleted after image export since the exported file contains the complete diagram. In url mode, the .drawio file is kept so you have a persistent local copy to re-edit or share.
url mode uses only Node.js's built-in zlib (deflate-raw compression) and child_process (browser open) — no external dependencies. The resulting https://app.diagrams.net/#R... URL is the same format the MCP Tool Server uses for XML, so behavior is identical.
The skill fetches shared guides from GitHub at runtime — the single source of truth for all draw.io MCP prompts across the repository. No extra files need to be copied during installation.
shared/xml-essentials.md— the condensed XML rules (skeleton, cell templates, labels, shapes, the layout grid, containers, swimlanes, edge styles), used when authoring XMLshared/xml-reference.md— the full XML reference, fetched only for layers, tags, metadata, tables, cross-functional grids and dark-mode colorsshared/mermaid-reference.md— Mermaid syntax for all supported diagram types plus flowchart styling, used when authoring Mermaid
A .drawio file is native mxGraphModel XML. Claude produces one two ways:
- Mermaid — terse text that the desktop CLI converts to
.drawioand lays out automatically. Preferred for standard diagram types when the desktop app is installed. - XML — generated directly, for custom styling, precise positioning, or specific shape libraries. Needs no desktop app, so it's the universal fallback (
.drawiofile orurl).
Both routes end up as the same native .drawio format, immediately editable in draw.io. Mermaid conversion and ELK layout run locally via the desktop CLI — there is no server dependency.
The skill works on your machine: it writes .drawio files locally and exports them with your local draw.io Desktop. Without Desktop, scripts/mermaid-to-drawio.js converts Mermaid in a local headless browser, which downloads draw.io's scripts from viewer.diagrams.net and the diagram's fonts from Google Fonts; the Mermaid itself is not sent. The bundled hosted server is used for diagrams shown inline in a chat, and those diagrams are sent to mcp.draw.io to render them. It doesn't store them, and no account is needed: see the privacy policy for AI assistants. To keep everything local, remove or disable the drawio MCP server that comes with the plugin (/mcp in Claude Code), or point .mcp.json at a self-hosted MCP App Server.
This repository offers multiple ways to integrate draw.io with AI assistants:
- Codex Plugin — the same
drawioskill for Codex CLI - GitHub Copilot Plugin — the same
drawioskill for GitHub Copilot - MCP App Server — Inline diagrams in chat (Claude.ai, VS Code)
- MCP Tool Server — Opens diagrams in browser via MCP (Claude Desktop)
- Project Instructions — Claude.ai Projects, no install needed