mcp-comfy-ui-builder
Enables discovery of ComfyUI nodes and building/managing workflows with real-time execution via WebSocket. Provides 50+ tools for node discovery, workflow building, template usage, model management, and batch/chain execution.
README
mcp-comfy-ui-builder
<img src="assets/icon.svg" width="48" height="48" alt="" align="left" />
ComfyUI Node Discovery — seed knowledge base and MCP tools for Cursor/Claude.
Publishable to the MCP Registry via server.json and mcpName.
What is this
- Knowledge base: Seed
knowledge/base-nodes.jsonandnode-compatibility.jsonfrom bundled data (62 seed nodes; 100–600+ after sync). No external services required for suggest/build. - Sync: Custom packs from ComfyUI-Manager; nodes from running ComfyUI via
sync-nodesCLI or on MCP startup. - MCP server (50+ tools): Node discovery, dynamic workflow builder, 9 templates (txt2img, txt2img_flux, img2img, …), WebSocket real-time execution, batch/chain, model management, plugin system.
- Real-time execution: Sub-second progress via WebSocket with automatic polling fallback; ~90% less network traffic for batch runs.
Install
npm install mcp-comfy-ui-builder
Or from source: git clone https://github.com/MIt9/mcp-comfy-ui-builder.git && cd mcp-comfy-ui-builder && npm install
Quick start
-
Build (postbuild fills knowledge from seed)
npm run build npm run mcp -
Use knowledge in code
import baseNodes from './knowledge/base-nodes.json' assert { type: 'json' };
Commands
| Command | Description |
|---|---|
npm run seed |
Fill knowledge from seed. Use --force to overwrite. |
npm run sync-manager |
Update custom packs list from ComfyUI-Manager |
npm run sync-nodes |
Sync nodes from running ComfyUI to knowledge base (requires COMFYUI_HOST) |
npm test |
Run tests (vitest) |
npm run mcp |
Start MCP server (after npm run build) |
Documentation
Single entry point — task-oriented navigation:
- doc/README.md — where to start, task-based navigation
- doc/INDEX.md — complete list of documents and links
- doc/QUICK-REFERENCE.md — commands, examples, troubleshooting
- doc/GETTING-STARTED.md — quick start
- doc/MCP-SETUP.md — connect MCP in Cursor/Claude
- doc/DOCKER-SETUP.md —
docker pull siniidrozd/mcp-comfy-ui-builder| docker-compose for MCP + ComfyUI - Knowledge base: knowledge/README.md, doc/knowledge-base-usage-guide.md
- Workflow Builder: doc/workflow-builder.md — templates, params, save/load, ComfyUI format
- Planning: ROADMAP.md, NEXT-STEPS.md, TODO.md — current v2.3.x, next Phase 10 (QoL)
- Contributing: CONTRIBUTING.md
- MCP Registry: server.json and
mcpNamein package.json; see MCP Registry quickstart to publish afternpm publish.
Requirements
- Node.js 18+
MCP Server (Cursor / Claude)
Server provides 50+ tools across 9 categories:
Core Features
Node Discovery:
- list_node_types, get_node_info, check_compatibility, suggest_nodes
- discover_nodes_live, search_nodes, sync_nodes_to_knowledge
Dynamic Workflow Builder:
- create_workflow, add_node, connect_nodes, validate_workflow
- Build workflows programmatically without JSON manipulation
Templates & Macros:
- list_templates, build_workflow — Pre-built templates (txt2img, img2img, inpainting, upscale, LoRA, ControlNet, batch)
- create_template, apply_template — Parameterized templates
- list_macros, insert_macro — Reusable sub-workflows
Real-time execution 📡
- execute_workflow_sync — Execute with WebSocket progress streaming (sub-second updates)
- execute_workflow_stream — Full event history collection (WebSocket-only)
- get_execution_progress — Real-time progress with node-level granularity
- execute_batch — Concurrent execution with 90% reduced network traffic
- execute_chain — Sequential workflows with data passing
Resources & Model Management:
- get_system_resources — GPU/VRAM/RAM + recommendations (max resolution, model size, batch size); call first before building workflows to avoid OOM
- list_models, check_model_exists, get_workflow_models
- Supports checkpoint, lora, vae, controlnet, upscale, embedding, clip
Outputs & Queue:
- list_outputs, download_output, download_all_outputs
- list_queue, interrupt_execution, clear_queue
Plugins:
- list_plugins, reload_plugins — Data-only plugin system
Install (requires COMFYUI_PATH):
- install_custom_node, install_model — Install nodes and models via ComfyUI-Manager
WebSocket features
- <100ms latency for progress updates (vs 1.5s polling)
- Node-level tracking: See exactly which node is executing with progress percentage
- Automatic fallback: Gracefully falls back to polling if WebSocket unavailable
- Shared connection: Single WebSocket for batch/chain execution (90% reduced traffic)
Set COMFYUI_HOST environment variable for execution/model/output tools:
export COMFYUI_HOST="http://localhost:8188"
See doc/MCP-SETUP.md for full tool list and doc/WEBSOCKET-GUIDE.md for real-time features.
Running MCP
From project root, first build the project, then start the server:
npm run build
npm run mcp
Or without npm: node dist/mcp-server.js. Server works via stdio (stdin/stdout). More details → doc/MCP-SETUP.md.
Connect MCP (Cursor / Claude)
What you need: Node.js 18+, one-time build (npm run build), absolute path to dist/mcp-server.js, restart after config change. If the server fails to start with «spawn node ENOENT», use the full path to node in command (run which node and put that path). See doc/MCP-SETUP.md → Troubleshooting.
Minimal config (knowledge and workflow tools only):
{
"mcpServers": {
"comfy-ui-builder": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/mcp-comfy-ui-builder/dist/mcp-server.js"]
}
}
}
Use full path in command (e.g. "/opt/homebrew/bin/node") if Cursor/IDE reports «spawn node ENOENT».
With ComfyUI execution (execute_workflow, get_execution_status, list_outputs, etc.): add "env": { "COMFYUI_HOST": "http://127.0.0.1:8188" } to the server block. See doc/MCP-SETUP.md for full checklist, optional env vars (COMFYUI_PATH, COMFYUI_KNOWLEDGE_DIR), and troubleshooting.
Publish on GitHub
-
Create a new repository on GitHub: name
mcp-comfy-ui-builder, visibility Public (or Private). Do not initialize with README, .gitignore, or license (project already has them). -
Add remote and push:
git remote add origin https://github.com/MIt9/mcp-comfy-ui-builder.git git branch -M main git push -u origin main -
If you fork this repo, replace
MIt9with your GitHub username in the URLs above.
Cursor: Settings → MCP; Claude Desktop: config file ~/Library/Application Support/Claude/claude_desktop_config.json (macOS). Replace the path with your absolute path to dist/mcp-server.js, then restart the app. Full guide: doc/MCP-SETUP.md.
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。