io.github.hj1003862396/draw-flow-mcp-server
平台与服务by hj1003862396
面向 Next AI Draw.io 的 MCP server,支持 AI 驱动的图表生成与浏览器实时预览。
什么是 io.github.hj1003862396/draw-flow-mcp-server?
面向 Next AI Draw.io 的 MCP server,支持 AI 驱动的图表生成与浏览器实时预览。
README
Next AI Draw.io MCP Server
MCP (Model Context Protocol) server that enables AI agents like Claude Desktop and Cursor to generate and edit draw.io diagrams with real-time browser preview.
Self-contained - includes an embedded HTTP server, no external dependencies required.
Quick Start
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
Installation
Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
VS Code
Add to your VS Code settings (.vscode/mcp.json in workspace or user settings):
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
Cursor
Add to Cursor MCP config (~/.cursor/mcp.json):
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
Cline (VS Code Extension)
- Click the MCP Servers icon in Cline's top menu bar
- Select the Configure tab
- Click Configure MCP Servers to edit
cline_mcp_settings.json - Add the drawio server:
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
Claude Code CLI
claude mcp add drawio -- npx @next-ai-drawio/mcp-server@latest
Other MCP Clients
Use the standard MCP configuration with:
- Command:
npx - Args:
["@next-ai-drawio/mcp-server@latest"]
Usage
- Restart your MCP client after updating config
- Ask the AI to create a diagram:
"Create a flowchart showing user authentication with login, MFA, and session management"
- The diagram appears in your browser in real-time!
Features
- Real-time Preview: Diagrams appear and update in your browser as the AI creates them
- Version History: Restore previous diagram versions with visual thumbnails - click the clock button (bottom-right) to browse and restore earlier states
- Natural Language: Describe diagrams in plain text - flowcharts, architecture diagrams, etc.
- Edit Support: Modify existing diagrams with natural language instructions
- Export: Save diagrams as
.drawiofiles - Self-contained: Embedded server, works offline (except draw.io UI which loads from
embed.diagrams.netby default, configurable viaDRAWIO_BASE_URL)
Available Tools
| Tool | Description |
|---|---|
start_session | Opens browser with real-time diagram preview |
create_new_diagram | Create a new diagram from XML (requires xml argument) |
edit_diagram | Edit diagram by ID-based operations (update/add/delete cells) |
get_diagram | Get the current diagram XML |
export_diagram | Save diagram to a .drawio file |
How It Works
┌─────────────────┐ stdio ┌─────────────────┐
│ Claude Desktop │ <───────────> │ MCP Server │
│ (AI Agent) │ │ (this package) │
└─────────────────┘ └────────┬────────┘
│
┌────────▼────────┐
│ Embedded HTTP │
│ Server (:6002) │
└────────┬────────┘
│
┌────────▼────────┐
│ User's Browser │
│ (draw.io embed) │
└─────────────────┘
- MCP Server receives tool calls from Claude via stdio
- Embedded HTTP Server serves the draw.io UI and handles state
- Browser shows real-time diagram updates via polling
Configuration
| Variable | Default | Description |
|---|---|---|
PORT | 6002 | Port for the embedded HTTP server |
DRAWIO_BASE_URL | https://embed.diagrams.net | Base URL for the draw.io embed. Set this to use a self-hosted draw.io instance for private deployments. |
Private Deployment (Self-hosted draw.io)
For security-sensitive environments that require private deployment of draw.io:
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"],
"env": {
"DRAWIO_BASE_URL": "https://drawio.your-company.com"
}
}
}
}
You can deploy your own draw.io instance using the official Docker image:
docker run -d -p 8080:8080 jgraph/drawio
Then set DRAWIO_BASE_URL=http://localhost:8080 (or your server's URL).
Troubleshooting
Port already in use
If port 6002 is in use, the server will automatically try the next available port (up to 6020).
Or set a custom port:
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"],
"env": { "PORT": "6003" }
}
}
}
"No active session"
Call start_session first to open the browser window.
Browser not updating
Check that the browser URL has the ?mcp= query parameter. The MCP session ID connects the browser to the server.
License
Apache-2.0
常见问题
io.github.hj1003862396/draw-flow-mcp-server 是什么?
面向 Next AI Draw.io 的 MCP server,支持 AI 驱动的图表生成与浏览器实时预览。
相关 Skills
MCP构建
by anthropics
聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。
✎ 想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。
Slack动图
by anthropics
面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。
✎ 帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。
接口设计评审
by alirezarezvani
审查 REST API 设计是否符合行业规范,自动检查命名、HTTP 方法、状态码与文档覆盖,识别破坏性变更并给出设计评分,适合评审接口方案和版本迭代前把关。
✎ 做API和架构方案时,它能帮你提前揪出接口设计问题并对齐最佳实践,评审视角系统,团队协作更省心。
相关 MCP Server
Slack 消息
编辑精选by Anthropic
Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。
✎ 这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。
by netdata
io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。
✎ 这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。
by d4vinci
Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。
✎ 这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。