Draw.io MCP Server

Draw.io MCP Server

Enables AI assistants to create and edit draw.io diagrams programmatically, supporting a wide range of diagram types and styles.

Category
Visit Server

README

šŸŽØ Draw.io MCP Server

CI PyPI Python License: MIT

Let your AI assistant create beautiful draw.io diagrams — just describe what you want.

An MCP server that generates draw.io / diagrams.net XML files programmatically. Works with GitHub Copilot (agent mode), Claude Desktop, Cursor, and any MCP-compatible client.

<!-- mcp-name: io.github.yohasacura/drawio-mcp -->


✨ What Can It Do?

Capability Details
šŸ—ļø Diagram types Flowcharts, UML, ER, C4, BPMN, mindmaps, architecture, network, Kubernetes, and more
šŸŽØ Styling 310+ shape presets, 44 edge styles, 21 color themes
šŸ“ Auto-layout Sugiyama DAG, tree, horizontal, vertical, grid, flowchart engines
šŸ”€ Smart routing Obstacle-aware orthogonal edge routing with automatic port distribution
āœļø Full editing Add, move, resize, delete, restyle any element after creation
šŸ“„ Multi-page Multiple pages and layers for complex diagrams
šŸ“„ Import/Export Load existing .drawio files, modify, and save back
🧹 One-click cleanup Polish command that auto-fixes layout, overlaps, edges, and labels

šŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • uv (recommended) or pip

Install from PyPI

pip install drawio-mcp

Or with uv:

uvx drawio-mcp

Install from source

git clone https://github.com/yohasacura/drawio-mcp.git
cd drawio-mcp
uv sync
uv run drawio-mcp

šŸ”Œ Setup with Your AI Client

VS Code (GitHub Copilot)

Add to your VS Code settings or .vscode/mcp.json:

{
  "servers": {
    "drawio-mcp": {
      "command": "uvx",
      "args": ["drawio-mcp"]
    }
  }
}

Then use Copilot in Agent mode and ask it to create diagrams.

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "drawio-mcp": {
      "command": "uvx",
      "args": ["drawio-mcp"]
    }
  }
}

Cursor

Add to your Cursor MCP settings:

{
  "mcpServers": {
    "drawio-mcp": {
      "command": "uvx",
      "args": ["drawio-mcp"]
    }
  }
}

šŸ’¬ Example Prompts

Once connected, try these in your AI chat:

Prompt What you get
"Create a flowchart for a user login process" Login flow with decision nodes and error paths
"Create a C4 context diagram for an e-commerce system" System context with actors and external systems
"Make a UML class diagram with User, Order, and Product" Class diagram with relationships
"Create an ER diagram for a blog database" Entity-relationship diagram with tables
"Build an org chart for a startup" Tree layout with roles and hierarchy
"Draw an AWS architecture with API Gateway, Lambda, DynamoDB" Cloud architecture diagram
"Create a Kubernetes deployment diagram" K8s diagram with pods, services, ingress
"Make a network topology with servers and firewalls" Network diagram with device icons

šŸ’” Tip: Always end with "...and save it as filename.drawio" to get a file you can open in draw.io.


šŸ› ļø Tool Reference

The server exposes 5 tools, each with an action parameter:

diagram — Lifecycle

create Ā· save Ā· load Ā· import_xml Ā· list Ā· get_xml Ā· add_page Ā· add_layer

draw — Content

add_vertices Ā· add_edges Ā· add_group Ā· update_cells Ā· delete_cells Ā· add_title Ā· add_legend Ā· build_dag Ā· build_full

style — Appearance

build Ā· apply_theme Ā· list_vertex_presets Ā· list_edge_presets Ā· list_themes

layout — Positioning

sugiyama Ā· tree Ā· horizontal Ā· vertical Ā· grid Ā· flowchart Ā· smart_connect Ā· align Ā· distribute Ā· polish Ā· relayout Ā· compact Ā· reroute_edges Ā· resolve_overlaps Ā· fix_labels Ā· optimize_connections Ā· resize_container

inspect — Read-only

cells Ā· overlaps Ā· ports Ā· info


šŸŽØ Style Reference

<details> <summary><b>310+ Vertex Presets</b> (click to expand)</summary>

Basic shapes: RECTANGLE ROUNDED_RECTANGLE ELLIPSE CIRCLE DIAMOND TRIANGLE HEXAGON CYLINDER CLOUD PARALLELOGRAM ACTOR PROCESS DOCUMENT DATA_STORE NOTE CARD CALLOUT TEXT CUBE STAR FOLDER and more

Themed boxes: BLUE_BOX GREEN_BOX ORANGE_BOX RED_BOX YELLOW_BOX PURPLE_BOX GRAY_BOX DARK_BOX TEAL_BOX WHITE_BOX

Flowchart: FLOWCHART_PROCESS FLOWCHART_DECISION FLOWCHART_TERMINATOR FLOWCHART_DATA FLOWCHART_DOCUMENT FLOWCHART_DATABASE FLOWCHART_START FLOWCHART_END and 25+ more

UML: UML_CLASS UML_INTERFACE UML_ACTOR UML_COMPONENT UML_PACKAGE UML_NODE UML_LIFELINE UML_FRAME

C4: C4_SYSTEM C4_CONTAINER C4_COMPONENT C4_PERSON C4_EXTERNAL C4_DATABASE C4_WEB_BROWSER

ER: ER_ENTITY ER_WEAK_ENTITY ER_ATTRIBUTE ER_KEY_ATTRIBUTE ER_RELATIONSHIP and more

BPMN: BPMN_TASK BPMN_START_EVENT BPMN_END_EVENT BPMN_GATEWAY BPMN_POOL BPMN_LANE and more

Architecture: ARCH_SERVICE ARCH_DATABASE ARCH_QUEUE ARCH_CLOUD ARCH_API ARCH_GATEWAY ARCH_CONTAINER ARCH_FIREWALL ARCH_SERVER ARCH_LOAD_BALANCER and 20+ more

Network: NETWORK_SERVER NETWORK_ROUTER NETWORK_SWITCH NETWORK_FIREWALL NETWORK_CLOUD NETWORK_STORAGE and 40+ more

Cloud/K8s: AWS_CLOUD AWS_LAMBDA AWS_S3 AWS_EC2 AWS_RDS AWS_SQS K8S_POD K8S_SERVICE K8S_DEPLOYMENT K8S_INGRESS and more

Containers: SWIMLANE GROUP GROUP_TRANSPARENT GROUP_DASHED

Plus: State machine, Sequence diagram, Mindmap, DFD, SysML, ArchiMate, Cisco, Mockup/Wireframe, Infographic, and more

</details>

<details> <summary><b>44 Edge Presets</b> (click to expand)</summary>

General: DEFAULT ORTHOGONAL STRAIGHT CURVED ENTITY_RELATION DASHED DOTTED BIDIRECTIONAL NO_ARROW

Styled: ROUNDED ROUNDED_DASHED THICK THICK_ROUNDED

Colored: COLORED_BLUE COLORED_GREEN COLORED_RED COLORED_ORANGE COLORED_PURPLE COLORED_YELLOW COLORED_GRAY

UML: UML_ASSOCIATION UML_INHERITANCE UML_IMPLEMENTATION UML_DEPENDENCY UML_AGGREGATION UML_COMPOSITION

ER: ER_ONE_TO_ONE ER_ONE_TO_MANY ER_MANY_TO_MANY ER_ZERO_TO_ONE ER_ZERO_TO_MANY

Flow: DATA_FLOW CONTROL_FLOW ASYNC SYNC BPMN_FLOW BPMN_MESSAGE_FLOW

</details>

<details> <summary><b>21 Color Themes</b> (click to expand)</summary>

BLUE GREEN YELLOW ORANGE RED PURPLE GRAY PINK TURQUOISE TEAL DARK_BLUE DARK_GREEN DARK_RED DARK_ORANGE DARK_PURPLE DARK WHITE C4_BLUE C4_LIGHT_BLUE C4_SKY C4_GRAY

</details>

<details> <summary><b>Connection Ports</b> (click to expand)</summary>

TOP BOTTOM LEFT RIGHT TOP_LEFT TOP_RIGHT BOTTOM_LEFT BOTTOM_RIGHT TOP_LEFT_THIRD TOP_RIGHT_THIRD BOTTOM_LEFT_THIRD BOTTOM_RIGHT_THIRD LEFT_TOP_THIRD LEFT_BOTTOM_THIRD RIGHT_TOP_THIRD RIGHT_BOTTOM_THIRD

</details>


šŸ§‘ā€šŸ’» Development

git clone https://github.com/yohasacura/drawio-mcp.git
cd drawio-mcp
uv sync

# Run tests
uv run pytest tests/ -v

# Run the server locally
uv run drawio-mcp

Project Structure

src/drawio_mcp/
ā”œā”€ā”€ server.py           # MCP server — 5 tools with 40+ actions
ā”œā”€ā”€ models.py           # Core XML model (DrawioFile, Diagram, MxCell)
ā”œā”€ā”€ styles.py           # Style builder, presets, and themes
ā”œā”€ā”€ layout.py           # Layout helpers (tree, grid, port distribution)
ā”œā”€ā”€ layout_engine.py    # Advanced layout (Sugiyama, edge routing, polish)
└── validation.py       # Input validation

šŸ“ Contributing

See CONTRIBUTING.md for guidelines on bug reports, feature requests, and pull requests.

šŸ“„ License

MIT Ā© yohasacura

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured