Draw Flow Mcp Server

io.github.hj1003862396由 GitHub 账号 hj1003862396 发布v1.0.2更新于 Oct 24, 2026

MCP server for Next AI Draw.io - AI-powered diagram generation with real-time browser preview

发布方自己的服务:draw.io

已验证STDIO仅桌面开发者工具媒体与设计

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手生成和编辑 draw.io 图表,在浏览器中实时预览,并可导出为 .drawio 文件。

可以做什么
启动图表会话,打开带 draw.io 实时预览的浏览器窗口,并在助手工作时持续更新,支持版本历史以恢复先前状态,并用会话 ID 连接浏览器与服务器。根据助手提供的 XML 创建新图表。通过基于 ID 的单元格操作(更新、新增、删除)编辑现有图表。读取当前图表 XML,并将图表导出为 .drawio 文件。
适用场景
适合希望助手把自然语言描述转成流程图或架构图、并在浏览器中实时查看生成与修改过程的场景,也适合修改和导出已有的 draw.io 图表。
运行要求
通过 stdio 在本地运行,通常用 npx 启动,因此需要 Node.js。内置 HTTP 服务器默认使用 6002 端口(被占用时依次尝试到 6020),并会打开浏览器窗口。draw.io 界面默认从 embed.diagrams.net 加载,可通过 DRAWIO_BASE_URL 指向自建实例;PORT 和 DRAWIO_BASE_URL 为可选配置。未声明需要账号或 API 密钥。
安装前请注意
浏览器预览默认从 embed.diagrams.net 加载 draw.io 界面,图表内容可能发送给该第三方;涉及私密或安全敏感内容时应将 DRAWIO_BASE_URL 设为自建实例。导出时服务器会向磁盘写入 .drawio 文件,并开放本地 HTTP 端口。图表按助手指令创建和修改,使用前应检查生成内容。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Draw Flow Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

json
{  "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):

json
{  "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):

json
{  "mcpServers": {    "drawio": {      "command": "npx",      "args": ["@next-ai-drawio/mcp-server@latest"]    }  }}

Cursor

Add to Cursor MCP config (~/.cursor/mcp.json):

json
{  "mcpServers": {    "drawio": {      "command": "npx",      "args": ["@next-ai-drawio/mcp-server@latest"]    }  }}

Cline (VS Code Extension)

  1. Click the MCP Servers icon in Cline's top menu bar
  2. Select the Configure tab
  3. Click Configure MCP Servers to edit cline_mcp_settings.json
  4. Add the drawio server:
json
{  "mcpServers": {    "drawio": {      "command": "npx",      "args": ["@next-ai-drawio/mcp-server@latest"]    }  }}

Claude Code CLI

bash
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

  1. Restart your MCP client after updating config
  2. Ask the AI to create a diagram:

    "Create a flowchart showing user authentication with login, MFA, and session management"

  3. 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 .drawio files
  • Self-contained: Embedded server, works offline (except draw.io UI which loads from embed.diagrams.net by default, configurable via DRAWIO_BASE_URL)

Available Tools

ToolDescription
start_sessionOpens browser with real-time diagram preview
create_new_diagramCreate a new diagram from XML (requires xml argument)
edit_diagramEdit diagram by ID-based operations (update/add/delete cells)
get_diagramGet the current diagram XML
export_diagramSave 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) │                                 └─────────────────┘
  1. MCP Server receives tool calls from Claude via stdio
  2. Embedded HTTP Server serves the draw.io UI and handles state
  3. Browser shows real-time diagram updates via polling

Configuration

VariableDefaultDescription
PORT6002Port for the embedded HTTP server
DRAWIO_BASE_URLhttps://embed.diagrams.netBase 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:

json
{  "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:

bash
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:

json
{  "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

来源:README.md,提交 fe245b6

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Draw 集成