Skip to content
Back to search

drawio

MarketplaceWorks with Claude CodeGitHub

Official draw.io plugins for AI coding assistants.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/jgraph/drawio-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/jgraph/drawio-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/jgraph-drawio-mcp/badge.svg)](/listings/jgraph-drawio-mcp)

HTML

<a href="/listings/jgraph-drawio-mcp"><img src="/api/listings/jgraph-drawio-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 15 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. {
  2. "name": "drawio",
  3. "owner": {
  4. "name": "draw.io",
  5. "url": "https://www.drawio.com"
  6. },
  7. "description": "Official draw.io plugins for AI coding assistants.",
  8. "plugins": [
  9. {
  10. "name": "drawio",
  11. "source": "./plugins/claude-code",
  12. "category": "diagrams"
  13. }
  14. ]
  15. }
README.md · README · 288 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Draw.io MCP Server
  2. The official [draw.io](https://www.draw.io) MCP (Model Context Protocol) server that enables LLMs to create and open diagrams in the draw.io editor.
  3. [![An AI assistant turns a prompt for a customer refund flowchart into an editable draw.io diagram in the chat, with Open in draw.io, Copy and Download diagram buttons](https://www.drawio.com/img/mcp/drawio-mcp-hero-poster.jpg?v=7)](https://www.drawio.com/mcp/)
  4. ▶ [Watch the video](https://www.drawio.com/mcp/) and set up draw.io in your AI assistant on drawio.com/mcp.
  5. ## Four Ways to Create Diagrams
  6. This repository offers four approaches for integrating draw.io with AI assistants. Pick the one that fits your setup:
  7. | | [MCP App Server](#mcp-app-server) | [MCP Tool Server](#mcp-tool-server) | [Assistant Plugins](#assistant-plugins-claude-code-codex-cli-github-copilot) | [Project Instructions](#alternative-project-instructions-no-mcp-required) |
  8. |---|---|---|---|---|
  9. | **How it works** | Renders diagrams inline in chat | Opens diagrams in your browser | Generates `.drawio` files, optional PNG/SVG/PDF export or browser URL | Claude generates draw.io URLs via Python |
  10. | **Diagram output** | Interactive viewer embedded in conversation | draw.io editor in a new tab | `.drawio`, `.drawio.png` / `.svg` / `.pdf`, or browser URL | Clickable link to draw.io |
  11. | **Requires installation** | No (hosted at `mcp.draw.io`) | Yes (npm package) | One-line plugin install (draw.io Desktop only for PNG/SVG/PDF export) | No — just paste instructions |
  12. | **Supports XML, CSV, Mermaid** | XML and Mermaid | ✅ All three | XML and Mermaid (Mermaid needs draw.io Desktop) | ✅ All three |
  13. | **Editable in draw.io** | Via "Open in draw.io" button | ✅ Directly | ✅ Directly | Via link |
  14. | **Works with** | Claude.ai, ChatGPT, VS Code, Cursor, GitHub Copilot CLI, any MCP Apps host | Claude Desktop, Cursor, OpenCode, any MCP client | Claude Code, Codex CLI, GitHub Copilot, Cursor, Antigravity, OpenCode | Claude.ai (with Projects) |
  15. | **Best for** | Inline previews in chat | Local desktop workflows | Local development workflows | Quick setup, no install needed |
  16. ---
  17. ## Guides
  18. User guides with tested prompts and examples are in the draw.io documentation, and the setup for each assistant is on [drawio.com/mcp](https://www.drawio.com/mcp/):
  19. - [Write prompts](https://www.drawio.com/docs/manual/generate/ai-assistants/prompts/): Mermaid or draw.io XML, speed and models
  20. - [Diagram types and examples](https://www.drawio.com/docs/manual/generate/ai-assistants/diagram-types/) and the [gallery of every diagram type](https://www.drawio.com/docs/manual/generate/ai-assistants/gallery/)
  21. - [Change and style diagrams](https://www.drawio.com/docs/manual/generate/ai-assistants/edit-and-style/): changes by prompt, color themes, styles
  22. - [Install options and output formats](https://www.drawio.com/docs/manual/generate/drawio-mcp-server/)
  23. - [Diagram viewer](https://www.drawio.com/docs/manual/generate/ai-assistants/diagram-viewer/)
  24. The gallery is generated from [`docs/images/gallery/gallery.json`](docs/images/gallery/gallery.json) and the editable light and dark SVGs next to it; drawio.com reads them when the site is built.
  25. ---
  26. ## MCP App Server
  27. The MCP App server renders draw.io diagrams **inline** in AI chat interfaces using the [MCP Apps](https://modelcontextprotocol.io/docs/extensions/apps) protocol. Instead of opening a browser tab, diagrams appear directly in the conversation as interactive iframes.
  28. The official hosted endpoint is available at:
  29. ```
  30. https://mcp.draw.io/mcp
  31. ```
  32. Add this URL as a remote MCP server in Claude.ai, ChatGPT, VS Code (GitHub Copilot), Cursor, GitHub Copilot CLI, or any MCP Apps-compatible host — no installation required. On Claude.ai, draw.io is also listed in the [connector directory](https://claude.ai/directory/draw-io) and can be added from there in one click; in ChatGPT and Codex, in the [plugin directory](https://chatgpt.com/plugins/plugin_asdk_app_6abea666ca5081919375ed8d1d38da95). In Cursor (≥ 2.6), diagrams render inline in the Agent chat ([one-click install](https://cursor.com/en/install-mcp?name=drawio&config=eyJ1cmwiOiJodHRwczovL21jcC5kcmF3LmlvL21jcCJ9)); on older builds, use the stdio [`@drawio/mcp`](mcp-tool-server/README.md) tool server instead. In GitHub Copilot CLI, run `copilot mcp add --transport http drawio https://mcp.draw.io/mcp`; a terminal can't show diagrams inline, so it gets a link that opens each diagram in draw.io.
  33. You can also run the server locally via Node.js or the [`jgraph/drawio-mcp`](https://hub.docker.com/r/jgraph/drawio-mcp) Docker image, or deploy your own instance to Cloudflare Workers.
  34. **Tools:**
  35. - **`create_diagram`** — Renders draw.io XML or Mermaid (28 diagram types) as an interactive diagram inline in chat
  36. - **`search_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 calling `create_diagram`.
  37. - **`get_drawio_reference`** — Returns the XML or Mermaid generation reference, which the model reads once per format before its first diagram.
  38. - **`create_semantic_diagram`** — The fast mode for flowcharts and swimlane diagrams, used only when you ask for a quick or cheap diagram (see below).
  39. **Fast mode.** Ask for speed or economy in so many words, in any language, and the model describes a flowchart or swimlane diagram instead of placing every shape: the steps, the lanes, the transitions and a row and a column per step. The server lays it out, routes the lines and styles it. For example:
  40. - "**Quickly** draw a flowchart of returning a book at a library kiosk …"
  41. - "… **Just a rough sketch is fine.**" or "**Keep it cheap: use as few tokens as possible.**"
  42. - "Zeichne **schnell** ein Flussdiagramm für …", "… **Bitte mit wenig Aufwand.**" or "Erstelle **sparsam** ein Swimlane-Diagramm …"
  43. Without such words, and for every other diagram type, the model uses `create_diagram`, which places the shapes with more care. In the benchmark of 15 November 2026 (Claude Code with Sonnet 5.5 and Opus 5.5, 20 prompts in English and German written for the test, three runs each), the models chose the right tool in 118 of 120 sessions. With the wish, the diagram came 3 to 4 times sooner (Sonnet 14 s instead of 46 s, Opus 27 s instead of 108 s), with less than half the output tokens. In blind comparisons with the diagrams the models placed themselves, the fast ones won 0.61 (Sonnet) and 0.67 (Opus) of the judgements, but each model lost on one flowchart without lanes. Limits:
  44. - It draws flowcharts and swimlanes only, in the calm theme, without styles of your choosing. A flowchart asked for as a "rough sketch" therefore comes in the calm theme, not with the hand-drawn look `create_diagram` gives a sketch.
  45. - Flowcharts without lanes get up to 24 steps; larger ones are drawn with `create_diagram`.
  46. Self-hosted servers leave the tool out with `DRAWIO_SEMANTIC_TYPES=off`. Details are in [`shared/semantic/FAST-MODE.md`](shared/semantic/FAST-MODE.md).
  47. **[Full documentation →](mcp-app-server/README.md)**
  48. > **Note:** Diagrams appear inline in hosts that support the MCP Apps extension, such as Claude.ai, ChatGPT, VS Code with GitHub Copilot and Cursor. In other hosts, such as GitHub Copilot CLI, the tool still works and answers with a link that opens the diagram in draw.io.
  49. ---
  50. ## MCP Tool Server
  51. 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`](https://www.npmjs.com/package/@drawio/mcp) on npm.
  52. Quick start: `npx @drawio/mcp`
  53. Setup instructions are available for Claude Desktop, Claude Code, VS Code (GitHub Copilot), Cursor (with one-click install), and OpenCode.
  54. **[Full documentation →](mcp-tool-server/README.md)**
  55. ---
  56. ## Assistant Plugins (Claude Code, Codex CLI, GitHub Copilot)
  57. The `drawio` skill packaged as a plugin for AI coding assistants (under [`plugins/`](plugins/README.md)): 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`. The Claude Code and Cursor plugins also bundle the hosted MCP App Server, so diagrams show inline where the host supports it; the Codex and Copilot ports need no MCP setup. The same skill ships for four hosts:
  58. **Claude Code** ([full documentation →](plugins/claude-code/README.md)) — install from this repo's marketplace:
  59. ```
  60. /plugin marketplace add jgraph/drawio-mcp
  61. /plugin install drawio@drawio
  62. ```
  63. Or load it directly from a local clone with `claude --plugin-dir ./plugins/claude-code`.
  64. **Codex CLI** ([full documentation →](plugins/codex/drawio/README.md)) — install from the same marketplace repo:
  65. ```bash
  66. codex plugin marketplace add jgraph/drawio-mcp
  67. codex plugin add drawio@drawio
  68. ```
  69. **GitHub Copilot CLI** ([full documentation →](plugins/copilot/README.md)) — install from the same marketplace repo:
  70. ```bash
  71. copilot plugin marketplace add jgraph/drawio-mcp
  72. copilot plugin install drawio@drawio
  73. ```
  74. Other 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](plugins/copilot/README.md).
  75. **Cursor** ([full documentation →](plugins/cursor/README.md)) — the same skill plus the hosted MCP App Server, so diagrams also render inline in Cursor's Agent chat. Install it from the Cursor Marketplace (**Customize** → **drawio** → **Install**), or copy `plugins/cursor` to `~/.cursor/plugins/local/drawio` and reload the window.
  76. **Antigravity** ([full documentation →](plugins/antigravity/README.md)) — install from the plugin's directory on GitHub:
  77. ```bash
  78. agy plugin install https://github.com/jgraph/drawio-mcp/tree/main/plugins/antigravity
  79. ```
  80. **OpenCode** needs no plugin at all: it discovers skills in `.opencode/skills/` and `.claude/skills/` (and their `~/` equivalents), so the Claude Code skill folder works as-is — see [OpenCode (no plugin needed)](plugins/README.md#opencode-no-plugin-needed) for the one-line install.
  81. By default, the plugin writes a `.drawio` file and opens it in draw.io. Mention a format in your request to change the output:
  82. - **png / svg / pdf** — exports using the draw.io desktop CLI with `--embed-diagram`
  83. - **url** — compresses the XML with Node.js's built-in `zlib` and opens the result at `app.diagrams.net`. No draw.io Desktop needed; the `.drawio` file is kept locally as a persistent copy.
  84. ---
  85. ## Alternative: Project Instructions (No MCP Required)
  86. 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.
  87. **[Full documentation →](project-instructions/README.md)**
  88. ---
  89. ## Diagram layouts
  90. 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:
  91. | Layout pass | What it does | App Server (`create_diagram`) | Tool Server (`open_drawio_xml`) | Assistant Plugins | Project Instructions |
  92. |---|---|---|---|---|---|
  93. | **ELK auto-layout** (`postLayout: "elk"`) | Re-arranges nodes into a clean layered layout; routes the edges as part of it | ✅ | — | ✅ via draw.io Desktop CLI (`--layout`) | — |
  94. | **libavoid routing** (`routing: "libavoid"`) | Keeps node positions; reroutes connectors orthogonally *around* the shapes | ✅ | ✅ from **v1.3.0** | ✅ via draw.io Desktop CLI (`--layout libavoid`) | — |
  95. - These apply to **draw.io XML** diagrams. **Mermaid** diagrams are auto-laid-out already, so neither pass is needed.
  96. - 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.
  97. - Pick one, not both: ELK already routes its own edges, so adding libavoid on top is redundant. Use `postLayout` to re-arrange a layout, or `routing` to tidy the connectors on a layout you placed deliberately.
  98. ---
  99. ## Data Residency & Offline Use
  100. If you're deploying in an environment with strict data restrictions, here is exactly
  101. where diagram data goes for each approach.
  102. **No component sends your diagram to a cloud rasterizer.** `convert.diagrams.net` (or
  103. any cloud export endpoint) is not called anywhere in this repository, and there is no
  104. "local dependency missing → fall back to cloud" path. PNG/SVG/PDF export happens only
  105. in the assistant plugins, which shell out to your **locally installed draw.io Desktop CLI**
  106. (located via `which drawio`); if it isn't installed, the `.drawio` file is kept and
  107. nothing is sent.
  108. ### Does your diagram leave the machine?
  109. | Approach | Diagram leaves the machine? |
  110. |---|---|
  111. | **MCP App Server — hosted (`mcp.draw.io`)** | **Yes** — it is sent to the draw.io server as the MCP request. Self-host instead (below) to keep it local. |
  112. | **MCP App Server — self-hosted** (local Node, the `jgraph/drawio-mcp` Docker image, or your own Cloudflare) | No — processed by your server and embedded in HTML that renders client-side. |
  113. | **MCP Tool Server** (`@drawio/mcp`) | No — carried in the URL `#fragment`, which browsers do not transmit to the server. |
  114. | **Assistant Plugins** (Claude Code, Codex CLI, GitHub Copilot, Cursor, Antigravity) | No — written locally and exported by your local draw.io Desktop CLI. The Claude Code and Cursor plugins also bundle the hosted App Server: diagrams drawn with it are sent to `mcp.draw.io` (row above). |
  115. By default the servers do not write diagram content to their logs — only request
  116. metadata (method, session, status, timing). The Cloudflare-hosted App Server logs
  117. response bodies only when run with `DEBUG=true`.
  118. ### Reducing external requests
  119. Even when the diagram itself stays local, the rendering loads draw.io's web-app /
  120. viewer **code** from `app.diagrams.net` and `viewer.diagrams.net` by default. These
  121. fetch application code and assets — not your diagram — but they are still outbound
  122. requests. To reduce or remove them:
  123. - **App Server:** build with the `VIEWER_PATH` environment variable to inline the
  124. viewer instead of loading it from `viewer.diagrams.net`. Server-side, it makes a
  125. version check against `viewer.diagrams.net` at startup and daily (no data, 5 s
  126. timeout, safe to block), and `search_shapes` queries `icons.diagrams.net` with the
  127. search terms unless `DRAWIO_ICON_SERVICE_URL=off`. Set `DRAWIO_BASE_URL` to a
  128. self-hosted draw.io instance to have "Open in draw.io" and the link for clients
  129. without inline diagrams open there; the inline viewer still loads its code and
  130. shape images from diagrams.net.
  131. - **Tool Server:** set the `DRAWIO_BASE_URL` environment variable to a self-hosted
  132. draw.io instance. Its two server-side passes also fetch **code** from
  133. `viewer.diagrams.net` once per draw.io release and cache it per user: the libavoid
  134. routing core (`routing: "libavoid"`, also primed at install time) and the
  135. drawio-elk bundle (`postLayout: "elk"`, fetched on first use, overridable with
  136. `DRAWIO_ELK_URL`). Not requesting those passes makes no such call; the diagram is
  137. never part of one either way.
  138. - **Assistant Plugins:** the opt-in `url` output mode opens the diagram at
  139. `app.diagrams.net` (hardcoded — no `DRAWIO_BASE_URL` equivalent). Use the default
  140. `.drawio` output or local Desktop export instead if you need to avoid that request.
  141. ### Your LLM is a separate consideration
  142. The diagram is *generated* by the LLM. If you use a hosted model, the diagram content
  143. is produced in that provider's cloud regardless of where this MCP server runs.
  144. End-to-end isolation requires a locally hosted model as well.
  145. ### Verifying
  146. The only reliable way to confirm a deployment makes **no** outbound calls is to run it
  147. with network egress blocked (or watch the browser's Network tab) and verify it still
  148. renders. We recommend this for any strict-isolation deployment.
  149. ---
  150. ## XML Reference (Single Source of Truth)
  151. 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:
  152. **[`shared/xml-reference.md`](shared/xml-reference.md)**
  153. All four approaches above use this file as their single source of truth for LLM prompts:
  154. | Approach | How it accesses the reference |
  155. |----------|-------------------------------|
  156. | MCP App Server | Reads the file at startup / build time and returns it from the `get_drawio_reference` tool |
  157. | MCP Tool Server | Reads the file at startup (from repo or bundled copy via `prepack`) and returns it from the `get_drawio_reference` tool; the `open_drawio_xml` description carries the condensed [`shared/xml-essentials.md`](shared/xml-essentials.md) |
  158. | Assistant Plugins (Claude Code, Codex CLI, GitHub Copilot) | Fetch the condensed [`shared/xml-essentials.md`](shared/xml-essentials.md) by its GitHub raw URL, and the full reference only for layers, tags, metadata, tables, cross-functional grids and dark-mode colors |
  159. | Project Instructions | Users copy the condensed `shared/xml-essentials.md` into their Claude Project, and the full reference only when they need those topics |
  160. When updating XML generation guidance, edit `shared/xml-reference.md` — changes propagate to all consumers automatically. If the change touches a rule that `shared/xml-essentials.md` summarizes, update that line there too.
  161. ---
  162. ## Shape Search Index
  163. 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.
  164. 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.
  165. `shape-search/search-index.json` is committed to the repository. The [Update Shape Search Index](.github/workflows/update-search-index.yml) GitHub Action regenerates it from the released draw.io client after every draw.io release (drawio-dev dispatches `drawio-release` when its build has finished) and daily as a fallback, and opens a pull request when the shapes changed. Once merged, the tool server picks it up from the CDN; the hosted app server bundles it, so it needs a deploy.
  166. To regenerate the index manually (e.g. when iterating on the generator itself):
  167. ```bash
  168. cd shape-search
  169. npm install
  170. npm run generate
  171. # Rebuild the MCP App Server worker to embed the updated index
  172. cd ../mcp-app-server
  173. npm run build:worker
  174. ```
  175. The generator fetches `app.min.js` directly from the public draw.io web app, so no local checkout of the draw.io source is needed.
  176. ---
  177. ## Development
  178. ```bash
  179. # MCP App Server
  180. cd mcp-app-server
  181. npm install
  182. npm start
  183. # MCP Tool Server
  184. cd mcp-tool-server
  185. npm install
  186. npm start
  187. ```
  188. ## Related Resources
  189. - [draw.io](https://www.draw.io) - Free online diagram editor
  190. - [draw.io Desktop](https://github.com/jgraph/drawio-desktop) - Desktop application
  191. - [@drawio/mcp on npm](https://www.npmjs.com/package/@drawio/mcp) - This package on npm
  192. - [drawio-mcp on GitHub](https://github.com/jgraph/drawio-mcp) - Source code repository
  193. - [Mermaid.js Documentation](https://mermaid.js.org/intro/)
  194. - [MCP Specification](https://modelcontextprotocol.io/)
  195. - [MCP Apps Extension](https://modelcontextprotocol.io/docs/extensions/apps)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.