
Draw.io 模型上下文协议(MCP)服务器
概览
让我们用最普及的图表工具 Draw.io (Diagrams.net) 做一些氛围图。 - 内置 Draw.io 编辑器 - 无需浏览器扩展 - MCP 服务器允许 AI 代理控制 Draw.io 图 - 通过 MCP 工具创建、检查和修改程序化图示 - 复杂图图层管理 - 支持任何 MCP 客户端(Claude Desktop、Claude Code、Zed、Codex 等) Draw.io MCP 服务器为 AI 代理带来了 Draw.io 的图表功能。它提供能够创建、读取、更新和删除图表元素的 MCP 工具——让 AI 助手自动构建架构图、流程图和可视化文档。 两种使用方式:1. - 服务器主机 Draw.io,直接在浏览器中访问 2.- 通过扩展连接到浏览器中运行的 Draw.io 实验性:与 的集成正在进行中,但目前被上游的 CSP 问题阻碍——详见 DESKTOP.md。
概述(AI 翻译)
英语 ·简体中文
让我们用最普及的图表工具 Draw.io (Diagrams.net) 做一些氛围图。
主要亮点
- Claude Code 插件:先按
/plugin marketplace add lgazo/drawio-mcp-server然后/plugin install drawio,配合/drawio-open和/drawio-status斜杠命令 npx drawio-mcp-server install编写claude-code、claude-desktop、codex、zed、opencode或all的 MCP 配置。- 文档持久化工具:
set-document-title和save-document - Draw.io 库 API 版本兼容性机制
- 在IFrames中启用 Draw.io MCP
- AWS、GCP、Azure、Cisco19 和 CiscoSafe 模板可在运行时自动发现,从 drawio 侧边栏中发现
- 多文档目标定位,使用
list-documents和target_document选择器,支持多标签页工作流程 - 多页定位,配备页范围工具所需的
target_page选择器 - 为实时操作提供逐文档先出序列化,使多个代理可以安全地处理不同文件
- 页面管理工具:
list-pages、get-current-page、create-page、copy-page、rename-page - 导入、嵌入或展开美人鱼图解
- Firefox 支持回归,TLS 模式必要
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Draw.io MCP server
Let’s do some Vibe Diagramming with the most wide-spread diagramming tool called Draw.io (Diagrams.net).
Key Highlights
-
Claude Code plugin:
/plugin marketplace add lgazo/drawio-mcp-serverthen/plugin install drawio, with/drawio-openand/drawio-statusslash commands -
npx drawio-mcp-server installwrites the MCP config forclaude-code,claude-desktop,codex,zed,opencode, orall -
Document persistence tools:
set-document-titleandsave-document -
Draw.io library API version compatibility mechanism
-
Enable Draw.io MCP in IFrames
-
AWS, GCP, Azure, Cisco19, and CiscoSafe stencils auto-discovered at runtime from drawio’s sidebar
-
Multi-document targeting with
list-documentsandtarget_documentselectors for multi-tab workflows -
Multi-page targeting with required
target_pageselectors for page-scoped tools -
Per-document FIFO serialization for live operations, so multiple agents can work on different files safely
-
Page management tools:
list-pages,get-current-page,create-page,copy-page,rename-page -
Import, embed, or expand Mermaid diagrams
-
Firefox support is back, TLS mode is necessary
-
Server supports TLS mode and optionally generates self-signed certificates
-
Import and export diagrams from/to XML, SVG (with embedded XML), or PNG (with embedded XML)
-
Edge geometry control with waypoints and automatic self-connector routing
-
Parent-child relationships for nested shapes and grouping
-
Unified Server and Extension in the same mono-repo
-
Built-in Draw.io editor - no browser extension required
安装
npx -y drawio-mcp-server --editor配置
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["-y", "drawio-mcp-server", "--editor"]
}
}
}