
Draw.io
STDIOMCP server for Draw.io diagramming integration with AI agentic systems
MCP server for Draw.io diagramming integration with AI agentic systems
Let's do some Vibe Diagramming with the most wide-spread diagramming tool called Draw.io (Diagrams.net).
The Draw.io MCP server is a Model Context Protocol (MCP) implementation that brings powerful diagramming capabilities to AI agentic systems. This integration enables:
As an MCP-compliant tool, it follows the standard protocol for tool integration, making it compatible with any MCP client. This implementation is particularly valuable for creating AI systems that need to:
The tool supports bidirectional communication, allowing both control of Draw.io instances and extraction of diagram information for further processing by AI agents in your MCP ecosystem.
To use the Draw.io MCP server, you'll need:
--inspect
flagNote: The Draw.io desktop app or web version must be accessible to the system where the MCP server runs.
Install Claude Desktop
Open or create the configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Update it to include this server:
npm
{ "mcpServers":{ "drawio":{ "command":"npx", "args":[ "-y", "drawio-mcp-server" ] } } }
pnpm
{ "mcpServers":{ "drawio":{ "command":"pnpm", "args":[ "dlx", "drawio-mcp-server" ] } } }
This is an alternative MCP client in case you like terminal and you plan to connect to your own Ollama instance.
The configuration is usually in: ~/.local/share/oterm/config.json
npm
{ "mcpServers": { "drawio": { "command": "npx", "args": [ "-y", "drawio-mcp-server" ] } } }
pnpm
{ "mcpServers": { "drawio": { "command": "pnpm", "args": [ "dlx", "drawio-mcp-server" ] } } }
In order to control the Draw.io diagram, you need to install dedicated Browser Extension.
The Draw.io MCP server provides the following tools for programmatic diagram interaction:
get-selected-cell
Retrieves the currently selected cell in Draw.io with all its attributes
Returns: JSON object containing cell properties (ID, geometry, style, value, etc.)
get-shape-categories
Retrieves available shape categories from the diagram's library
Returns: Array of category objects with their IDs and names
get-shapes-in-category
Retrieves all shapes in a specified category from the diagram's library
Parameters:
category_id
: Identifier of the category to retrieve shapes from
Returns: Array of shape objects with their properties and stylesget-shape-by-name
Retrieves a specific shape by its name from all available shapes
Parameters:
shape_name
: Name of the shape to retrieve
Returns: Shape object including its category and style informationadd-rectangle
Creates a new rectangle shape on the active Draw.io page with customizable properties:
x
, y
coordinates)width
, height
)add-edge
Creates a connection between two cells (vertexes)
Parameters:
source_id
: ID of the source celltarget_id
: ID of the target celltext
: Optional text label for the edgestyle
: Optional style properties for the edgedelete-cell-by-id
Removes a specified cell from the diagram
Parameters:
cell_id
: ID of the cell to deleteadd-cell-of-shape
Adds a new cell of a specific shape type from the diagram's library
Parameters:
shape_name
: Name of the shape to createx
, y
: Position coordinates (optional)width
, height
: Dimensions (optional)text
: Optional text contentstyle
: Optional additional style properties