Flowchart MCP
Enables AI assistants to create, edit, and export flowcharts through a local web-based editor with visual drag-and-drop, real-time sync, and 14 MCP tools for full node/edge CRUD.
README
Flowchart MCP
<!-- Badges --> <div align="center">
</div>
<div align="center">
A Model Context Protocol server that empowers AI assistants to create, edit, and export flowcharts through a local web-based editor.
</div>
✨ Features
| Feature | Description |
|---|---|
| 14 MCP Tools | Full CRUD for nodes and edges, auto-layout, themes, export, diagram introspection |
| Visual Editor | React Flow canvas — drag nodes, resize, connect via handles, zoom/pan, minimap |
| 7 Node Shapes | Rectangle, Diamond, Ellipse, Rounded Rectangle, Parallelogram, Cylinder, Hexagon |
| Edge Styling | Solid / Dashed / Dotted; optional arrows at start/end; custom labels and colors |
| Auto Layout | Layered graph layout in 4 directions: Top→Bottom, Left→Right, Bottom→Top, Right→Left |
| 4 Color Themes | Default (blue), Dark, Pastel, Colorful — one call to restyle all nodes |
| Real-time Sync | All editor changes are pushed to the MCP server via WebSocket within ~600ms |
| Export | PNG (Puppeteer rasterization), SVG, and native JSON |
| In-editor Editing | Drag shapes from the left panel, right-click context menus, collapsible sidebar |
🏗️ Architecture
AI Assistant
│
MCP JSON-RPC (stdio)
│
┌──────────────────▼──────────────────┐
│ Flowchart MCP Server │
│ │
│ ┌──────────┐ ┌──────────┐ ┌─────────┐│
│ │ MCP │ │ In-Mem │ │ Express ││
│ │ SDK │◄─┤ Store │◄─┤ HTTP ││
│ │ Stdio │ │ │ │ :3742 ││
│ └──────────┘ └──────────┘ └─────────┘│
│ ┌─────────┐│
│ WS push │ Express ││
│ │ WS ││
└──────────────────────────────┴────┬─────┘
│
┌────────────────────▼──────────┐
│ React Flow Web Editor │
│ │
│ ┌──────────┐ ┌─────┐ ┌──────┐ │
│ │ Shapes │ │ │ │ │ │
│ │ Panel │ │Canvas│ │Sidebar│
│ └──────────┘ │ │ │ │ │
│ └─────┘ └──────┘ │
│ ┌────────┐ ┌────────┐ │
│ │Controls│ │ MiniMap│ │
│ └────────┘ └────────┘ │
└────────────────────────────────┘
🚀 Quick Start
Prerequisites
- Node.js ≥ 20.14.0
- Chrome / Chromium (required for PNG export via Puppeteer)
1. Install
git clone https://github.com/Zafer-Liu/Flowchart_MCP.git
cd Flowchart_MCP
npm install
2. Build
npm run build
3. Configure Your MCP Client
OpenClaw — openclaw.json:
{
"mcpServers": {
"flowchart": {
"command": "node",
"args": ["D:/path/to/Flowchart_MCP/dist/server.js"]
}
}
}
Claude Desktop — ~/.config/claude-desktop/mcp.json:
{
"mcpServers": {
"flowchart": {
"command": "node",
"args": ["/absolute/path/to/Flowchart_MCP/dist/server.js"]
}
}
}
Cursor — Settings → MCP Servers:
{
"mcpServers": {
"flowchart": {
"command": "node",
"args": ["/absolute/path/to/Flowchart_MCP/dist/server.js"]
}
}
}
4. Run
# Production
npm start
# Development (tsx hot-reload)
npm run dev
On first run, the server automatically starts a background web server at http://localhost:3742 — no manual configuration needed.
🛠️ MCP Tools Reference
Diagram Management
create_diagram
Creates a new flowchart and returns the editor URL.
{ "title": "User Authentication Flow" }
Returns:
{
"diagram_id": "uuid-string",
"title": "User Authentication Flow",
"editor_url": "http://localhost:3742/?diagram=uuid-string"
}
open_editor · get_diagram · list_diagrams
open_editor— Get the editor URL for an existing diagramget_diagram— Read the full diagram state as JSONlist_diagrams— List all diagrams in the current session
export_diagram
Export the diagram to PNG, SVG, or JSON.
{
"diagram_id": "uuid-string",
"format": "png" | "svg" | "json",
"output_path": "/path/to/output.png"
}
Node Operations
add_node
Add a node with custom shape, position, and colors.
{
"label": "Process Order",
"shape": "rectangle", // rectangle | diamond | ellipse | rounded | parallelogram | cylinder | hexagon
"x": 100,
"y": 100,
"width": 160,
"height": 60,
"background_color": "#4A90D9",
"border_color": "#333333",
"text_color": "#FFFFFF"
}
update_node
Update any property of an existing node: label, shape, position, size, or colors.
remove_node
Remove a node and all its connected edges.
Edge Operations
add_edge
Create a directed connection between two nodes.
{
"source": "node-uuid-1",
"target": "node-uuid-2",
"label": "yes",
"style": "solid", // solid | dashed | dotted
"arrow_end": "arrow", // arrow | none
"arrow_start": "none", // arrow | none
"color": "#0052CC"
}
update_edge · remove_edge
Update or remove an edge.
Layout & Themes
auto_layout
Automatically arrange all nodes using a layered graph layout algorithm.
{
"direction": "TB" // TB | LR | BT | RL
}
| Direction | Layout |
|---|---|
TB |
Top → Bottom |
LR |
Left → Right |
BT |
Bottom → Top |
RL |
Right → Left |
apply_theme
Apply a preset color theme to all nodes in one call.
{ "theme": "default" } // default | dark | pastel | colorful
| Theme | Primary | Background | Border | Text |
|---|---|---|---|---|
default |
#4A90D9 | #F5F5F5 | #333333 | #000000 |
dark |
#1E1E1E | #2D2D2D | #555555 | #FFFFFF |
pastel |
#AED6F1 | #FDFEFE | #85C1E9 | #333333 |
colorful |
#E74C3C | #F9EBEA | #C0392B | #2C3E50 |
🎨 Web Editor Guide
Editor Layout
┌──────────────────────────────────────────────────────────────────┐
│ Toolbar: [New] [Export▾] [Auto Layout▾] [Theme▾] [+] [−] [⊡] │
├───────┬──────────────────────────────────────────────┬───────────┤
│ │ │ │
│ Shape │ React Flow Canvas │ Sidebar │
│ Panel │ (drag nodes · connect handles · zoom/pan) │ Properties│
│ │ │ Editor │
│ ───── │ │ │
│ Rect │ ┌──────────┐ ┌──────────┐ │ Node: │
│ Diam │ │ Start │───▶│ Process │ │ Label │
│ Ellip │ └──────────┘ └──────────┘ │ Shape │
│ ... │ │ │ Colors │
│ │ ┌────▼────┐ │ │
│ │ │Decision │ │ Edge: │
│ │ └─────────┘ │ Label │
│ │ │ Style │
├───────┴──────────────────────────────────────────────┴───────────┤
│ Status: ● Connected 3 nodes · 2 edges Updated 14:32:05 │
└──────────────────────────────────────────────────────────────────┘
Interactions
| Action | How |
|---|---|
| Add node | Drag shape from left panel onto canvas |
| Connect nodes | Hover node → drag from handle dot to another node |
| Select node/edge | Click on it — sidebar shows its properties |
| Move node | Drag the node body |
| Edit label | Double-click the label on canvas, or use sidebar |
| Delete | Select → Delete key |
| Context menu | Right-click node / edge / canvas |
| Zoom | Mouse wheel or + / − in toolbar |
| Fit view | ⊡ button in toolbar |
| Resize sidebar | Drag the divider between canvas and sidebar |
| Toggle minimap | Click ▼ 缩略图 / ▲ 缩略图 |
| Collapse shapes panel | Click ◀ / ▶ toggle at top of left panel |
Real-time Sync
All edits in the browser are synced back to the MCP server via WebSocket (~600ms debounce). When the AI assistant calls get_diagram, it receives the latest user-modified state.
⚙️ Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT |
3742 |
HTTP / WebSocket server port |
HOST |
localhost |
Host to bind |
Standalone Web Server
node dist/web-server-standalone.js
# Starts only the web editor on :3742 (no MCP transport)
# Useful for testing the editor independently
📁 Project Structure
Flowchart_MCP/
├── src/
│ ├── server.ts # Entry point — MCP stdio transport, global error handling
│ ├── tools/
│ │ └── index.ts # All 14 MCP tool definitions (zod schemas + handlers)
│ ├── store.ts # In-memory diagram store (Map-based, session-scoped)
│ ├── layout.ts # Layered graph auto-layout (Sugiyama-style)
│ ├── export.ts # PNG / SVG / JSON export via Puppeteer
│ ├── web-launcher.ts # Lazy web server startup / lifecycle manager
│ ├── web-server.ts # Express + WebSocket on :3742
│ └── web-server-standalone.ts # Standalone web server entry point
├── client/ # React Flow web editor (Vite build)
│ └── src/
│ ├── App.tsx # Root editor component, layout, canvas
│ ├── Sidebar.tsx # Node / edge property editor panel
│ ├── ShapesPanel.tsx # Draggable shape palette
│ ├── CustomNode.tsx # Custom React Flow node renderer (7 shapes)
│ ├── ContextMenu.tsx # Right-click context menu
│ └── types.ts # Shared TypeScript type definitions
├── dist/ # Compiled server JS (npm published)
├── package.json
├── tsconfig.json
└── LICENSE
🧰 Tech Stack
| Layer | Technology |
|---|---|
| Protocol | MCP SDK v1.12.0 · StdioServerTransport |
| Server Runtime | Node.js · TypeScript · tsx |
| HTTP Layer | Express 4 · ws (WebSocket) |
| Diagram Storage | In-memory (Map-based, session-scoped) |
| Export | Puppeteer 22 (Chromium) |
| Frontend | React 18 · React Flow · @xyflow/react · TypeScript |
| Build (server) | TypeScript compiler (tsc) |
| Build (client) | Vite |
📄 License
Copyright © 2026. Licensed under the Apache License 2.0.
<div align="center">
⭐ Stars · 🍴 Forks · 👁 Watchers are welcome!
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。