add-cell-of-shape
This tool allows you to add a new vertex cell on the target page of the current Draw.io document by its shape name.
Let an agent draw in Draw.io — shapes, edges, layers and pages, in the editor you have open.
LABSCO SUMMARY
This is not generating a file to open afterwards — shapes appear in the open canvas, and the agent can read the model back to see the result. Stencils being discovered from the sidebar is what lets it place a real GCP or Cisco icon instead of a labelled box.
A bridge into Draw.io that lets an agent create, read, modify and delete diagram elements. It either hosts the editor itself, reachable in your browser, or connects to Draw.io already running there through a browser extension. Vendor stencils are discovered from the sidebar at runtime, so cloud icons can be placed by their real names.
Node.js v22 or higher, run over stdio from npm as drawio-mcp-server. With the editor flag it hosts Draw.io itself and you open http://localhost:3000/ — nothing else to install. The alternative is the browser extension, which needs Draw.io already open in your browser; Firefox works but requires TLS mode, and the server can generate self-signed certificates for that itself. Integration with the desktop Electron app is not there yet, blocked upstream.
One command — npx -y drawio-mcp-server --editor
USE CASES
Find the right vendor shapes by category, place them on the page, and connect them with edges.
Read the model page by page, then edit labels and styles or delete the cells that no longer belong.
Create a layer for background or annotations and move the cells that belong there onto it.
Create the pages up front, then aim each set of edits at a named page — several agents can work in parallel that way.
Import the XML, or a Mermaid diagram, then export the result with the XML embedded so it stays editable.
List the connected documents and route the following calls to the tab you mean, rather than the first one open.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
add-cell-of-shapeThis tool allows you to add a new vertex cell on the target page of the current Draw.io document by its shape name.
add-edgeThis tool creates an edge, sometimes called also a relation, between two vertexes (cells). When source and target are the same shape (self-connector), a loop edge style is automatically applied if no custom style is provided.
add-rectangleThis tool allows you to add a new Rectangle vertex cell on the target page of the current Draw.io document.
copy-pageCreates a copy of an existing page in the target/current Draw.io document, appends the copy to the end of the page list, and returns the copied page metadata. When possible, the previously visible page is restored after the copy is created.
create-layerCreates a new layer on the target page.
create-pageAppends a new blank page to the current Draw.io document without changing the visible page when the runtime supports background page insertion.
delete-cell-by-idDeletes a cell from the target page, whether it is a vertex or edge.
edit-cellUpdate properties of an existing vertex/shape cell by its ID. Only provided fields are modified; unspecified properties remain unchanged.
edit-edgeUpdate properties of an existing edge by its ID. Only provided fields are modified; unspecified properties remain unchanged. Supports setting waypoints for edge geometry control.
export-diagramExport the target page or current diagram as SVG, PNG, or XML. Returns the diagram data as base64 (PNG) or text (SVG/XML). Optionally saves to a file.
get-active-layerGets the currently active layer information for the target page. If the target page is not currently visible, Draw.io may switch the visible page first because active-layer state is UI-bound.
get-current-pageGets the currently visible page metadata, including index, id, name, and whether it is active.
get-selected-cellThis tool retrieves the selected cell on the target page of the current Draw.io document. If the target page is not currently visible, Draw.io may switch the visible page first because selection is UI-bound.
get-shape-by-nameRetrieve a specific shape by its name from all available shapes in the diagram's library. It returns the shape and also the category it belongs.
get-shape-categoriesRetrieves available shape categories from the diagram's library. Library is split into multiple categories.
get-shapes-in-categoryRetrieve all shapes in the provided category from the diagram's library. A shape primarily contains style based on which you can create new vertex cells.
import-diagramImport a diagram from XML, SVG with embedded XML, or PNG with embedded XML into the current Draw.io instance. target_page is required for replace and add, and optional for new-page.
import-mermaidInsert a Mermaid diagram into the target Draw.io page. Conversion runs inside the Draw.io editor via its bundled Mermaid pipeline (EditorUi.parseMermaidDiagram). mode='native' converts supported Mermaid types into native mxGraph cells; unsupported types fall back to an embedded image cell. mode='embed' always emits a single image cell that preserves the Mermaid source for re-editing inside Draw.io. target_page is required for replace and add, and optional for new-page.
list-documentsLists all connected Draw.io document instances with their stable instance IDs and basic metadata.
list-layersLists all available layers on the target page with their IDs and names.
list-paged-modelRetrieves a paginated view of all cells (vertices and edges) on the target page. This tool provides access to the complete model data with essential fields only, sanitized to remove circular dependencies and excessive data.
list-pagesLists all pages in the current Draw.io document with their index, id, name, and current-page flag.
move-cell-to-layerMoves a cell from its current layer to a target layer.
rename-pageRenames the selected page without changing the visible page.
set-active-layerSets the active layer for creating new elements. All subsequent element creation will happen in this layer. If the target page is not currently visible, Draw.io may switch the visible page first because active-layer state is UI-bound.
set-cell-dataSets or updates a custom attribute on an existing cell.
set-cell-parentSets the parent of a cell, making it a child of the specified parent cell. This allows creating hierarchical relationships where moving the parent also moves its children.
set-cell-shapeUpdates the visual style of an existing vertex cell to match a library shape by name.
BEFORE YOU INSTALL
28 tools when we connected.
CONTEXT COST
Rated by the size of the 28 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx -y drawio-mcp-server --editor{
"mcpServers": {
"drawio": {
"command": "npx",
"args": [
"-y",
"drawio-mcp-server",
"--editor"
]
}
}
}claude mcp add-json drawio '{"type":"stdio","command":"npx","args":["-y","drawio-mcp-server","--editor"]}'{
"context_servers": {
"drawio": {
"command": "npx",
"args": [
"-y",
"drawio-mcp-server",
"--editor"
],
"env": {}
}
}
}[mcp_servers.drawio]
command = "npx"
args = ["-y", "drawio-mcp-server", "--editor"]{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"drawio": {
"type": "local",
"command": [
"npx",
"-y",
"drawio-mcp-server",
"--editor"
],
"enabled": true
}
}
}