mcp-integration
draw.io MCP server configuration, tools reference, and integration patterns
What this skill does
# draw.io MCP Server Integration
## Overview
There are two main MCP server options for draw.io integration:
1. **Official @drawio/mcp** (by jgraph) - The official MCP server from the draw.io team
2. **Community drawio-mcp-server** (by lgazo) - Community-built server with built-in editor
Both enable AI assistants to create, read, update, and manage draw.io diagrams programmatically.
---
## Official @drawio/mcp Server (by jgraph)
The official MCP server operates in multiple modes depending on the deployment context.
### Mode 1: MCP App Server (Hosted)
A hosted MCP endpoint that renders diagrams as interactive iframes directly in AI chat interfaces.
**Endpoint:** `https://mcp.draw.io/mcp`
**Features:**
- Renders diagrams as interactive iframes in chat (Claude.ai, VS Code chat, MCP Apps hosts)
- No installation required
- Diagrams are viewable and editable inline
- Supports all draw.io diagram types
**Configuration for Claude.ai:**
1. Go to Claude.ai Settings > MCP Servers
2. Add server URL: `https://mcp.draw.io/mcp`
3. Diagrams render inline in conversations
**Configuration for VS Code (Copilot Chat):**
```json
// .vscode/settings.json
{
"mcp": {
"servers": {
"drawio": {
"type": "http",
"url": "https://mcp.draw.io/mcp"
}
}
}
}
```
### Mode 2: MCP Tool Server (Local)
A locally-run MCP server that opens diagrams in the draw.io editor.
**Installation and Usage:**
```bash
npx @drawio/mcp
```
**Features:**
- Opens diagrams in local draw.io editor (desktop or browser)
- Supports XML, CSV, and Mermaid.js input formats
- Lightbox and dark mode options
- Full draw.io editor capabilities
**Configuration:**
```json
// .mcp.json (project-level)
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["-y", "@drawio/mcp"]
}
}
}
```
**Claude Desktop config:**
```json
// ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
// %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["-y", "@drawio/mcp"]
}
}
}
```
### Mode 3: Skill + CLI
Uses draw.io Desktop's command-line interface for generating native `.drawio` files and exporting to image formats.
**Requirements:**
- draw.io Desktop application installed
- `drawio` CLI available in PATH
**Capabilities:**
- Generate native `.drawio` files from XML
- Export to PNG, SVG, PDF with `--embed-diagram` flag for round-trip editing
- Batch export multiple pages
- Headless rendering (with `xvfb-run` on Linux)
**Export Commands:**
```bash
# Export to editable SVG
drawio --export --format svg --embed-diagram --output diagram.drawio.svg diagram.drawio
# Export to editable PNG
drawio --export --format png --embed-diagram --output diagram.drawio.png diagram.drawio
# Export to PDF
drawio --export --format pdf --output diagram.pdf diagram.drawio
# Export specific page
drawio --export --format svg --page-index 2 --output page3.svg diagram.drawio
# Export with custom dimensions
drawio --export --format png --width 1920 --border 10 --output diagram.png diagram.drawio
# Crop to content
drawio --export --format svg --crop --output cropped.svg diagram.drawio
```
### Mode 4: Project Instructions
Zero-installation mode that works by pasting draw.io generation instructions directly into a Claude Project's custom instructions. The AI generates clickable draw.io URLs using Python URL encoding.
**How it works:**
1. Paste the draw.io skill instructions into your Claude Project
2. Ask Claude to create a diagram
3. Claude generates XML and encodes it as a draw.io URL
4. Click the URL to open in draw.io
**URL format:**
```
https://app.diagrams.net/#R<URL-encoded-XML>
```
**Python URL generation:**
```python
import urllib.parse
xml = '''<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Hello" style="rounded=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="120" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>'''
encoded = urllib.parse.quote(xml, safe='')
url = f'https://app.diagrams.net/#R{encoded}'
print(url)
```
---
## Community drawio-mcp-server (by lgazo)
An open-source MCP server with a built-in web-based draw.io editor and comprehensive CRUD tools.
### Installation
```bash
# Run directly with npx (recommended)
npx -y drawio-mcp-server --editor
# Or install globally
npm install -g drawio-mcp-server
drawio-mcp-server --editor
```
**Version:** 1.8.0+ (MIT License)
### Built-in Editor
When started with `--editor`, the server launches a web-based draw.io editor:
```
http://localhost:3000/
```
Features:
- Full draw.io editor in the browser
- Real-time sync with MCP tool operations
- No draw.io Desktop installation needed
- Supports all draw.io features (shapes, styles, layers, etc.)
### CLI Options
```bash
drawio-mcp-server [options]
Options:
--editor Launch built-in web editor (default port 3000)
--port <number> Custom port for the editor
--file <path> Open a specific .drawio file on startup
--help Show help
```
### MCP Tools Reference
The community server exposes these MCP tools:
#### Shape Operations
| Tool | Description |
|------|-------------|
| `create_shape` | Create a new shape (vertex) |
| `update_shape` | Modify shape properties (position, size, style, label) |
| `delete_shape` | Remove a shape |
| `read_shape` | Get shape details (style, geometry, label) |
**create_shape parameters:**
```json
{
"label": "API Gateway",
"x": 100,
"y": 100,
"width": 140,
"height": 60,
"style": "rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;"
}
```
**update_shape parameters:**
```json
{
"id": "cell-id",
"label": "Updated Label",
"x": 200,
"y": 150,
"style": "fillColor=#d5e8d4;strokeColor=#82b366;"
}
```
#### Edge Operations
| Tool | Description |
|------|-------------|
| `create_edge` | Create a connector between shapes |
| `update_edge` | Modify edge properties (label, style, routing) |
| `delete_edge` | Remove an edge |
**create_edge parameters:**
```json
{
"source": "source-cell-id",
"target": "target-cell-id",
"label": "REST API",
"style": "edgeStyle=orthogonalEdgeStyle;strokeWidth=2;"
}
```
#### Text Operations
| Tool | Description |
|------|-------------|
| `create_text` | Create a text label element |
| `update_text` | Modify text properties |
#### Diagram Operations
| Tool | Description |
|------|-------------|
| `read_diagram` | Get the full diagram structure |
| `inspect_diagram` | Analyze diagram contents (shapes, edges, layers) |
| `clear_diagram` | Remove all elements |
#### Layer Operations
| Tool | Description |
|------|-------------|
| `create_layer` | Create a new diagram layer |
| `switch_layer` | Change the active layer |
| `list_layers` | List all layers |
### Browser Extension
Available for Chrome and Firefox. Enables the MCP server to interact with draw.io running in a browser tab.
**Chrome Extension:** Search "drawio-mcp" in Chrome Web Store
**Firefox Extension:** Search "drawio-mcp" in Firefox Add-ons
### "Vibe Diagramming" Support
The community server is designed for iterative, conversational diagram creation:
1. Start with a natural language description
2. AI creates shapes and edges via MCP tools
3. View results in the built-in editor
4. Provide refinement instructions
5. AI updates specific elements without regenerating everything
This is more efficient than regenerating full XML because only changed elements are modified.
---
## Configuration Examples
### Project-Level (.mcp.json)
```json
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["-y", "@drawio/mcp"]
}
}
}
```
Or with the community server:
```json
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["-y", "drawio-mcp-server", "--editor"]
}
}
}
```
### Claude Desktop
macOS: `~/Library/Application Support/Claude/claude_deRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.