{
  "markdown": "# mcp-comfy-ui-builder\n\n<img src=\"assets/icon.svg\" width=\"48\" height=\"48\" alt=\"\" align=\"left\" />\n\n[![CI](https://github.com/MIt9/mcp-comfy-ui-builder/actions/workflows/ci.yml/badge.svg)](https://github.com/MIt9/mcp-comfy-ui-builder/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/mcp-comfy-ui-builder.svg)](https://www.npmjs.com/package/mcp-comfy-ui-builder)\n[![Docker](https://img.shields.io/docker/v/siniidrozd/mcp-comfy-ui-builder?label=docker)](https://hub.docker.com/r/siniidrozd/mcp-comfy-ui-builder)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**ComfyUI Node Discovery** — seed knowledge base and MCP tools for Cursor/Claude.  \nPublishable to the [MCP Registry](https://modelcontextprotocol.io/registry/about) via `server.json` and `mcpName`.\n\n## What is this\n\n- **Knowledge base:** Seed `knowledge/base-nodes.json` and `node-compatibility.json` from bundled data (62 seed nodes; 100–600+ after sync). No external services required for suggest/build.\n- **Sync:** Custom packs from ComfyUI-Manager; nodes from running ComfyUI via `sync-nodes` CLI or on MCP startup.\n- **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.\n- **Real-time execution:** Sub-second progress via WebSocket with automatic polling fallback; ~90% less network traffic for batch runs.\n\n## Install\n\n```bash\nnpm install mcp-comfy-ui-builder\n```\n\nOr from source: `git clone https://github.com/MIt9/mcp-comfy-ui-builder.git && cd mcp-comfy-ui-builder && npm install`\n\n## Quick start\n\n1. **Build** (postbuild fills knowledge from seed)\n\n   ```bash\n   npm run build\n   npm run mcp\n   ```\n\n2. **Use knowledge in code**\n\n   ```ts\n   import baseNodes from './knowledge/base-nodes.json' assert { type: 'json' };\n   ```\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `npm run seed` | Fill knowledge from seed. Use `--force` to overwrite. |\n| `npm run sync-manager` | Update custom packs list from ComfyUI-Manager |\n| `npm run sync-nodes` | Sync nodes from running ComfyUI to knowledge base (requires COMFYUI_HOST) |\n| `npm test` | Run tests (vitest) |\n| `npm run mcp` | Start MCP server (after `npm run build`) |\n\n## Documentation\n\nSingle entry point — **task-oriented navigation**:\n\n- **[doc/README.md](doc/README.md)** — where to start, task-based navigation\n- **[doc/INDEX.md](doc/INDEX.md)** — complete list of documents and links\n- **[doc/QUICK-REFERENCE.md](doc/QUICK-REFERENCE.md)** — commands, examples, troubleshooting\n- **[doc/GETTING-STARTED.md](doc/GETTING-STARTED.md)** — quick start\n- **[doc/MCP-SETUP.md](doc/MCP-SETUP.md)** — connect MCP in Cursor/Claude\n- **[doc/DOCKER-SETUP.md](doc/DOCKER-SETUP.md)** — `docker pull siniidrozd/mcp-comfy-ui-builder` | docker-compose for MCP + ComfyUI\n- **Knowledge base:** [knowledge/README.md](knowledge/README.md), [doc/knowledge-base-usage-guide.md](doc/knowledge-base-usage-guide.md)\n- **Workflow Builder:** [doc/workflow-builder.md](doc/workflow-builder.md) — templates, params, save/load, ComfyUI format\n- **Planning:** [ROADMAP.md](ROADMAP.md), [NEXT-STEPS.md](NEXT-STEPS.md), [TODO.md](TODO.md) — current v2.3.x, next Phase 10 (QoL)\n- **Contributing:** [CONTRIBUTING.md](CONTRIBUTING.md)\n- **MCP Registry:** [server.json](server.json) and `mcpName` in package.json; see [MCP Registry quickstart](https://modelcontextprotocol.io/registry/quickstart) to publish after `npm publish`.\n\n## Requirements\n\n- Node.js 18+\n\n## MCP Server (Cursor / Claude)\n\nServer provides 50+ tools across 9 categories:\n\n### Core Features\n\n**Node Discovery:**\n- **list_node_types**, **get_node_info**, **check_compatibility**, **suggest_nodes**\n- **discover_nodes_live**, **search_nodes**, **sync_nodes_to_knowledge**\n\n**Dynamic Workflow Builder:**\n- **create_workflow**, **add_node**, **connect_nodes**, **validate_workflow**\n- Build workflows programmatically without JSON manipulation\n\n**Templates & Macros:**\n- **list_templates**, **build_workflow** — Pre-built templates (txt2img, img2img, inpainting, upscale, LoRA, ControlNet, batch)\n- **create_template**, **apply_template** — Parameterized templates\n- **list_macros**, **insert_macro** — Reusable sub-workflows\n\n**Real-time execution 📡**\n- **execute_workflow_sync** — Execute with **WebSocket progress streaming** (sub-second updates)\n- **execute_workflow_stream** — Full event history collection (WebSocket-only)\n- **get_execution_progress** — Real-time progress with node-level granularity\n- **execute_batch** — Concurrent execution with **90% reduced network traffic**\n- **execute_chain** — Sequential workflows with data passing\n\n**Resources & Model Management:**\n- **get_system_resources** — GPU/VRAM/RAM + recommendations (max resolution, model size, batch size); **call first** before building workflows to avoid OOM\n- **list_models**, **check_model_exists**, **get_workflow_models**\n- Supports checkpoint, lora, vae, controlnet, upscale, embedding, clip\n\n**Outputs & Queue:**\n- **list_outputs**, **download_output**, **download_all_outputs**\n- **list_queue**, **interrupt_execution**, **clear_queue**\n\n**Plugins:**\n- **list_plugins**, **reload_plugins** — Data-only plugin system\n\n**Install (requires COMFYUI_PATH):**\n- **install_custom_node**, **install_model** — Install nodes and models via ComfyUI-Manager\n\n### WebSocket features\n\n- **<100ms latency** for progress updates (vs 1.5s polling)\n- **Node-level tracking:** See exactly which node is executing with progress percentage\n- **Automatic fallback:** Gracefully falls back to polling if WebSocket unavailable\n- **Shared connection:** Single WebSocket for batch/chain execution (90% reduced traffic)\n\nSet `COMFYUI_HOST` environment variable for execution/model/output tools:\n```bash\nexport COMFYUI_HOST=\"http://localhost:8188\"\n```\n\nSee [doc/MCP-SETUP.md](doc/MCP-SETUP.md) for full tool list and [doc/WEBSOCKET-GUIDE.md](doc/WEBSOCKET-GUIDE.md) for real-time features.\n\n### Running MCP\n\nFrom project root, first build the project, then start the server:\n\n```bash\nnpm run build\nnpm run mcp\n```\n\nOr without npm: `node dist/mcp-server.js`. Server works via **stdio** (stdin/stdout). More details → [doc/MCP-SETUP.md](doc/MCP-SETUP.md).\n\n### Connect MCP (Cursor / Claude)\n\n**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](doc/MCP-SETUP.md) → Troubleshooting.\n\n**Minimal config** (knowledge and workflow tools only):\n```json\n{\n  \"mcpServers\": {\n    \"comfy-ui-builder\": {\n      \"command\": \"node\",\n      \"args\": [\"/ABSOLUTE/PATH/TO/mcp-comfy-ui-builder/dist/mcp-server.js\"]\n    }\n  }\n}\n```\n\nUse full path in `command` (e.g. `\"/opt/homebrew/bin/node\"`) if Cursor/IDE reports «spawn node ENOENT».\n\n**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](doc/MCP-SETUP.md) for full checklist, optional env vars (COMFYUI_PATH, COMFYUI_KNOWLEDGE_DIR), and troubleshooting.\n\n### Publish on GitHub\n\n1. Create a new repository on [GitHub](https://github.com/new): name `mcp-comfy-ui-builder`, visibility Public (or Private). Do **not** initialize with README, .gitignore, or license (project already has them).\n2. Add remote and push:\n\n   ```bash\n   git remote add origin https://github.com/MIt9/mcp-comfy-ui-builder.git\n   git branch -M main\n   git push -u origin main\n   ```\n\n3. If you fork this repo, replace `MIt9` with your GitHub username in the URLs above.\n\n**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](doc/MCP-SETUP.md).\n\n## License\n\nMIT\n",
  "bytes": 8096,
  "sha": "58d78b7a48a0eef13e26e7e59517ce9d8a69d7e9cf5b5186a419e3d6bd34731d",
  "repo_slug": "mit9/mcp-comfy-ui-builder",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_mit9_comfy_ui_builder_d78ed887/readme"
}