draw.io

v1.11.0
io.draw/mcp Checked 1 hour ago Published 8 days ago

Mermaid, PlantUML, CSV or XML in, editable draw.io diagrams out, live in chat.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

open_drawio_xml

Opens the draw.io editor with a diagram from draw.io XML. Use it for custom styling, precise positioning and stencil-based diagrams (cloud, network, P&ID, UI mockups, floor plans); prefer open_drawio_mermaid for flowcharts, sequence, class, ER and the other types Mermaid covers. XML rules: - Skeleton: <mxGraphModel adaptiveColors="auto"><root><mxCell id="0"/><mxCell id="1" parent="0"/>…</root></mxGraphModel>. Unique ids. No XML comments. - Vertex: <mxCell id="a" value="Label" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="40" y="40" width="140" height="60" as…

ParameterTypeDescription
content *stringThe draw.io XML content in mxGraphModel format.
darkstringDark mode setting. Default: auto
directionstringFlow direction for `postLayout: "elk"`: "vertical" (top-down, the default) or "horizontal" (left-to-right). Only meaningful together with `postLayout`.
lightboxbooleanOpen in lightbox mode (read-only view). Default: false
postLayoutstringOptional full re-layout (ELK layered flow), applied server-side before the diagram opens. The only value is "elk". It PLACES the vertices — your x/y coordinates then only need to express rough direc…
routingstringOptional obstacle-avoiding orthogonal edge-routing pass (libavoid), applied server-side before the diagram opens. The only value is "libavoid". It keeps your vertex positions and only recomputes the c…

open_drawio_csv

Opens the draw.io editor with a diagram generated from CSV data. The CSV format should follow draw.io's CSV import specification which allows creating org charts, flowcharts, and other diagrams from tabular data.

ParameterTypeDescription
content *stringThe CSV content following draw.io's CSV import format.
darkstringDark mode setting. Default: auto
lightboxbooleanOpen in lightbox mode (read-only view). Default: false

open_drawio_mermaid

Opens the draw.io editor with a diagram generated from Mermaid.js syntax, converted into an editable draw.io diagram. The recommended default for flowcharts, sequence, class, state and ER diagrams, gantt charts, mind maps, timelines, C4, architecture and the other types draw.io's Mermaid parser supports (28 in all). Call get_drawio_reference with format "mermaid" once before your first Mermaid diagram in a conversation: it lists the header keyword and syntax hints for every supported type (a misspelled header yields a blank diagram) and flowchart styling.

ParameterTypeDescription
content *stringThe Mermaid.js diagram definition. Example: 'graph TD; A-->B; B-->C;'
darkstringDark mode setting. Default: auto
lightboxbooleanOpen in lightbox mode (read-only view). Default: false
postLayoutstringOptional ELK layered layout for Mermaid FLOWCHARTS. The only value is "elk". draw.io's native Mermaid parser does its own layout, but it produces cramped or unbalanced output once the diagram has any…

get_drawio_reference

Returns a full draw.io diagram generation reference as Markdown. Format "mermaid": the header keyword and syntax hints for every Mermaid type draw.io supports, flowchart styling and the ELK layout; call it once before the first Mermaid diagram in a conversation. Format "xml": everything beyond the rules in the open_drawio_xml description (layers, tags, metadata and placeholders, tables, cross-functional grids, dark-mode colors, more styles and examples); only needed when a diagram uses those. A reference stays valid for the rest of the conversation.

ParameterTypeDescription
format *stringWhich reference to return: "xml" for open_drawio_xml, "mermaid" for open_drawio_mermaid.

list_pages

Lists the pages (diagrams) in a local .drawio file without loading full page content. Returns each page's index, id, name, and approximate stored size in bytes. Call this first on large multi-page files before get_page/set_page, so only the page you actually need gets loaded into context.

ParameterTypeDescription
path *stringAbsolute or relative path to the local file. Must end in .drawio or .xml.

get_page

Reads one page (diagram) from a local .drawio file and returns its raw mxGraphModel XML, decompressing it first if the file stores that page compressed. Use list_pages first to find the index, name, or id of the page you need.

ParameterTypeDescription
page *stringWhich page to read: a zero-based page index (e.g. "0"), the page's exact name, or the page's id as shown by list_pages.
path *stringAbsolute or relative path to the local file. Must end in .drawio or .xml.

set_page

Replaces the content of one page (diagram) in a local .drawio file with new mxGraphModel XML, leaving every other page in the file untouched. Compression of the replaced page matches whatever that page's original compression state was. Use list_pages/get_page first to find the target page.

ParameterTypeDescription
content *stringThe new page content as plain mxGraphModel XML (uncompressed). Must be a single <mxGraphModel> element without any <diagram> tags.
page *stringWhich page to replace: a zero-based page index (e.g. "0"), the page's exact name, or the page's id as shown by list_pages.
path *stringAbsolute or relative path to the local file. Must end in .drawio or .xml.

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…

ParameterTypeDescription
query *stringSpace-separated search keywords (e.g. 'pid globe valve', 'aws lambda', 'cisco router', 'kubernetes pod')
limitnumberMaximum number of results to return (default: 10, max: 50)