draw.io

io.draw由 draw.io 發布官方發布者v1.7.0更新於 Nov 7, 2026

Create draw.io diagrams in chat from Mermaid or XML, shown live and interactive. 10,000+ shapes.

已驗證Streamable HTTP可網頁執行開發者工具媒體與設計

概覽

AI 產生的概覽

draw.io 官方伺服器,讓助理用 Mermaid 或 draw.io XML 建立可互動圖表,並從 draw.io 圖形庫中尋找圖形。

可以做什麼
  • 用 Mermaid.js 語法或 draw.io XML 建立並顯示可互動圖表,可選自動排版與連線走線處理
  • 在約一萬個內建圖形中搜尋,涵蓋雲端架構、網路拓撲、P&ID、電氣、Cisco、Kubernetes、UML 與 BPMN,並回傳精確的樣式字串
  • 取得 draw.io XML 或 Mermaid 的產生參考,讓模型遵循格式與 XML 合法性規則
  • 在支援 MCP Apps 擴充的宿主中內嵌顯示圖表,其他宿主則回傳可在 draw.io 開啟的連結
適用情境
適合需要依提示產生流程圖、架構圖、網路拓撲、組織圖、ER 圖、UML 或 BPMN 並在對話中預覽的情況。適用於 Claude.ai、ChatGPT、VS Code、Cursor 等支援 MCP Apps 的用戶端。
執行需求
透過 streamable HTTP 連線至 mcp.draw.io 遠端端點;未宣告需要安裝、帳號或 API 金鑰。不支援內嵌圖表的宿主仍可使用,但只回傳連結而非內嵌檢視器。
安裝前請注意
託管端點會把圖表內容當作 MCP 請求接收,圖表會離開本機;自行託管可保持在本機。轉譯會從 diagrams.net 載入檢視器程式碼,圖形搜尋會查詢圖示服務(可關閉)。圖表內容同樣由你使用的 LLM 產生。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 draw.io,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.draw%2Fmcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "draw-io": {
      "type": "http",
      "url": "https://mcp.draw.io/mcp"
    }
  }
}

README

Draw.io MCP Server

The official draw.io MCP (Model Context Protocol) server that enables LLMs to create and open diagrams in the draw.io editor.

[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]

▶ Watch the video and set up draw.io in your AI assistant on drawio.com/mcp.

Four Ways to Create Diagrams

This repository offers four approaches for integrating draw.io with AI assistants. Pick the one that fits your setup:

MCP App ServerMCP Tool ServerAssistant PluginsProject Instructions
How it worksRenders diagrams inline in chatOpens diagrams in your browserGenerates .drawio files, optional PNG/SVG/PDF export or browser URLClaude generates draw.io URLs via Python
Diagram outputInteractive viewer embedded in conversationdraw.io editor in a new tab.drawio, .drawio.png / .svg / .pdf, or browser URLClickable link to draw.io
Requires installationNo (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
Supports XML, CSV, MermaidXML and Mermaid✅ All threeXML and Mermaid (Mermaid needs draw.io Desktop)✅ All three
Editable in draw.ioVia "Open in draw.io" button✅ Directly✅ DirectlyVia link
Works withClaude.ai, ChatGPT, VS Code, Cursor, GitHub Copilot CLI, any MCP Apps hostClaude Desktop, Cursor, OpenCode, any MCP clientClaude Code, Codex CLI, GitHub Copilot, Cursor, Antigravity, OpenCodeClaude.ai (with Projects)
Best forInline previews in chatLocal desktop workflowsLocal development workflowsQuick setup, no install needed

Guides

User guides with tested prompts and examples are in the draw.io documentation, and the setup for each assistant is on drawio.com/mcp:

The gallery is generated from docs/images/gallery/gallery.json and the editable light and dark SVGs next to it; drawio.com reads them when the site is built.


MCP App Server

The MCP App server renders draw.io diagrams inline in AI chat interfaces using the MCP Apps protocol. Instead of opening a browser tab, diagrams appear directly in the conversation as interactive iframes.

The official hosted endpoint is available at:

https://mcp.draw.io/mcp

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 and can be added from there in one click; in ChatGPT and Codex, in the plugin directory. In Cursor (≥ 2.6), diagrams render inline in the Agent chat (one-click install); on older builds, use the stdio @drawio/mcp 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.

You can also run the server locally via Node.js or the jgraph/drawio-mcp Docker image, or deploy your own instance to Cloudflare Workers.

Tools:

  • create_diagram — Renders draw.io XML or Mermaid (28 diagram types) as an interactive diagram inline in chat
  • 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.
  • get_drawio_reference — Returns the XML or Mermaid generation reference, which the model reads once per format before its first diagram.

Full documentation →

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.


MCP Tool Server

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 on npm.

Quick start: npx @drawio/mcp

Setup instructions are available for Claude Desktop, Claude Code, VS Code (GitHub Copilot), Cursor (with one-click install), and OpenCode.

Full documentation →


Assistant Plugins (Claude Code, Codex CLI, GitHub Copilot)

The drawio skill packaged as a plugin for AI coding assistants (under plugins/): 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:

Claude Code (full documentation →) — install from this repo's marketplace:

/plugin marketplace add jgraph/drawio-mcp/plugin install drawio@drawio

Or load it directly from a local clone with claude --plugin-dir ./plugins/claude-code.

Codex CLI (full documentation →) — install from the same marketplace repo:

bash
codex plugin marketplace add jgraph/drawio-mcpcodex plugin add drawio@drawio

GitHub Copilot CLI (full documentation →) — install from the same marketplace repo:

bash
copilot plugin marketplace add jgraph/drawio-mcpcopilot plugin install drawio@drawio

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.

Cursor (full documentation →) — 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.

Antigravity (full documentation →) — install from the plugin's directory on GitHub:

bash
agy plugin install https://github.com/jgraph/drawio-mcp/tree/main/plugins/antigravity

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) for the one-line install.

By default, the plugin writes a .drawio file and opens it in draw.io. Mention a format in your request to change the output:

  • png / svg / pdf — exports using the draw.io desktop CLI with --embed-diagram
  • 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.

Alternative: Project Instructions (No MCP Required)

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.

Full documentation →


Diagram layouts

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:

Layout passWhat it doesApp Server (create_diagram)Tool Server (open_drawio_xml)Assistant PluginsProject Instructions
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)—
libavoid routing (routing: "libavoid")Keeps node positions; reroutes connectors orthogonally around the shapes✅✅ from v1.3.0✅ via draw.io Desktop CLI (--layout libavoid)—
  • These apply to draw.io XML diagrams. Mermaid diagrams are auto-laid-out already, so neither pass is needed.
  • 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.
  • 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.

Data Residency & Offline Use

If you're deploying in an environment with strict data restrictions, here is exactly where diagram data goes for each approach.

No component sends your diagram to a cloud rasterizer. convert.diagrams.net (or any cloud export endpoint) is not called anywhere in this repository, and there is no "local dependency missing → fall back to cloud" path. PNG/SVG/PDF export happens only in the assistant plugins, which shell out to your locally installed draw.io Desktop CLI (located via which drawio); if it isn't installed, the .drawio file is kept and nothing is sent.

Does your diagram leave the machine?

ApproachDiagram leaves the machine?
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.
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.
MCP Tool Server (@drawio/mcp)No — carried in the URL #fragment, which browsers do not transmit to the server.
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).

By default the servers do not write diagram content to their logs — only request metadata (method, session, status, timing). The Cloudflare-hosted App Server logs response bodies only when run with DEBUG=true.

Reducing external requests

Even when the diagram itself stays local, the rendering loads draw.io's web-app / viewer code from app.diagrams.net and viewer.diagrams.net by default. These fetch application code and assets — not your diagram — but they are still outbound requests. To reduce or remove them:

  • App Server: build with the VIEWER_PATH environment variable to inline the viewer instead of loading it from viewer.diagrams.net. Server-side, it makes a version check against viewer.diagrams.net at startup and daily (no data, 5 s timeout, safe to block), and search_shapes queries icons.diagrams.net with the search terms unless DRAWIO_ICON_SERVICE_URL=off. Set DRAWIO_BASE_URL to a self-hosted draw.io instance to have "Open in draw.io" and the link for clients without inline diagrams open there; the inline viewer still loads its code and shape images from diagrams.net.
  • Tool Server: set the DRAWIO_BASE_URL environment variable to a self-hosted draw.io instance. Its two server-side passes also fetch code from viewer.diagrams.net once per draw.io release and cache it per user: the libavoid routing core (routing: "libavoid", also primed at install time) and the drawio-elk bundle (postLayout: "elk", fetched on first use, overridable with DRAWIO_ELK_URL). Not requesting those passes makes no such call; the diagram is never part of one either way.
  • Assistant Plugins: the opt-in url output mode opens the diagram at app.diagrams.net (hardcoded — no DRAWIO_BASE_URL equivalent). Use the default .drawio output or local Desktop export instead if you need to avoid that request.

Your LLM is a separate consideration

The diagram is generated by the LLM. If you use a hosted model, the diagram content is produced in that provider's cloud regardless of where this MCP server runs. End-to-end isolation requires a locally hosted model as well.

Verifying

The only reliable way to confirm a deployment makes no outbound calls is to run it with network egress blocked (or watch the browser's Network tab) and verify it still renders. We recommend this for any strict-isolation deployment.


XML Reference (Single Source of Truth)

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:

shared/xml-reference.md

All four approaches above use this file as their single source of truth for LLM prompts:

ApproachHow it accesses the reference
MCP App ServerReads the file at startup / build time and returns it from the get_drawio_reference tool
MCP Tool ServerReads 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
Assistant Plugins (Claude Code, Codex CLI, GitHub Copilot)Fetch the condensed 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
Project InstructionsUsers copy the condensed shared/xml-essentials.md into their Claude Project, and the full reference only when they need those topics

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.


Shape Search Index

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.

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.

shape-search/search-index.json is committed to the repository. The Update Shape Search Index 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.

To regenerate the index manually (e.g. when iterating on the generator itself):

bash
cd shape-searchnpm installnpm run generate
# Rebuild the MCP App Server worker to embed the updated indexcd ../mcp-app-servernpm run build:worker

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.


Development

bash
# MCP App Servercd mcp-app-servernpm installnpm start
# MCP Tool Servercd mcp-tool-servernpm installnpm start

Related Resources

來源:README.md,提交 2a0f570

工具

3

create_diagram

Create Diagram

Creates and displays an interactive draw.io diagram from Mermaid.js syntax or draw.io XML — provide exactly one. **Choose the format first.** Use `xml` for diagrams of boxes and lines up to about 30 shapes: flowcharts, pipelines, decision trees, org charts, ER schemas, UML class, state and use case diagrams, mind maps, timelines, architecture, cloud and network diagrams, swimlanes, UI mockups, floor plans and anything with stencils. You place every shape yourself, laid out for the chat view (see the XML reference). Use `mermaid` for sequenceDiagram, gantt, gitGraph, pie, journey, quadrantChart, xychart-beta, sankey-beta, requirementDiagram, C4Context/C4Container/C4Component, block-beta, packet-beta, kanban, radar-beta, treemap-beta, treeView-beta, venn-beta, ishikawa-beta, zenuml, wardley-beta, eventmodeling, and for flowcharts, class and state diagrams of more than about 30 shapes (flowcharts with postLayout elk). Whenever the user asks for draw.io XML or no Mermaid, use XML for the rest of the conversation. **Call `get_drawio_reference` before your first diagram in a conversation**, once per format, with the format you chose: "mermaid" has the syntax for every type (a misspelled header renders blank), "xml" the styles, layout grid, edges, containers, layers and dark mode. Call `search_shapes` first for industry icons (AWS, Azure, GCP, Cisco, Kubernetes, P&ID, electrical) or logos. XML essentials: <mxGraphModel adaptiveColors="auto"><root><mxCell id="0"/><mxCell id="1" parent="0"/>…</root></mxGraphModel>. Every cell has a unique id. Vertices: vertex="1" with <mxGeometry x y width height as="geometry"/>. Edges: edge="1" with source and target, always with a child <mxGeometry relative="1" as="geometry"/>. Put html=1 in every style and XML-escape HTML in values (&lt; &gt; &amp; &quot;). No XML comments. Don't add waypoints. Place the shapes yourself (no postLayout) and set `routing: "libavoid"` only when an edge would otherwise cross a shape.

輸入參數xmlmermaidroutingdirectionpostLayout

search_shapes

Search Shapes

Search the draw.io shape library by keywords. Returns matching shapes with their exact style strings, dimensions, and titles. Covers ~10,000 built-in stencils (cloud architecture, network topology, P&ID, electrical, Cisco, Kubernetes, BPMN) and, when those are sparse, supplements results with the draw.io icon service (brand/product logos and general-purpose concept icons, e.g. 'react', 'slack', 'shopping cart', 'solar panel'). Use ONLY for diagrams that need industry-specific, branded, or pictorial icons. Do NOT use for standard diagram types like flowcharts, UML, ERD, org charts, or mind maps — these use basic geometric shapes (rectangles, diamonds, circles, cylinders) that are already covered in the XML reference. Also skip if the user asks to use basic/simple shapes or says not to search. The style string from the results can be used directly in mxCell style attributes.

輸入參數limitquery必填

get_drawio_reference

Get draw.io Reference

Returns the draw.io diagram generation reference as Markdown. Format "xml": styles, the layout grid, edges, containers, swimlanes, layers, tags, metadata, dark mode, the layout and routing passes, and the well-formedness rules for create_diagram's xml. Format "mermaid": the header keyword and syntax hints for every Mermaid type draw.io supports, flowchart styling and the ELK layout. Call it once per format and conversation, before the first diagram in that format; the reference stays valid for the rest of the conversation.

輸入參數format必填

版本歷史

11
  1. v1.7.0最新Nov 7, 2026
  2. v1.5.0Nov 3, 2026
  3. v1.4.7Oct 31, 2026
  4. v1.4.2Oct 30, 2026
  5. v1.4.1Oct 19, 2026
  6. v1.4.0Oct 18, 2026
  7. v1.3.0Oct 18, 2026
  8. v1.2.0Oct 17, 2026
  9. v1.1.1Oct 13, 2026
  10. v1.1.0Oct 13, 2026
  11. v1.0.3Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Draw 整合