comfyui-mcp is an MCP server and Claude Code plugin that lets an agent operate a ComfyUI instance: generating images, video, and audio, authoring and running workflows, managing models and custom node packs, and controlling the server process. It runs on macOS, Linux, and Windows, auto-detects a local ComfyUI installation and port, and one configuration can also target a remote install on a LAN, VPS, or reverse proxy, or Comfy Cloud through an API key.
The server exposes 38 action-parameterized tools. Workflow authoring covers creation from templates, node-level modification, dry-run validation, Mermaid rendering in both directions, and a compact round-tripping DSL; the saved-workflow library can be listed, analyzed, queried without dumping the whole graph, flattened to resolve reroutes and subgraphs, sliced out of toggle-template monoliths, or read back from the graph ComfyUI embeds in a PNG. Model management searches HuggingFace and Civitai, tracks downloads into the right directory, and edits the extra search-path configuration.
On top of the tools, the Claude Code plugin adds slash commands, skills, subagents, and hooks — model-family guides that carry samplers, CFG values, resolutions, and curated download URLs, installer packs bundling node packs with model URLs and a workflow, a VRAM watchdog before a run is enqueued, and agents that diagnose failed runs, optimize workflows, and research node packs. A separate sidebar panel agent drives the live ComfyUI graph and runs on a Claude, ChatGPT, or Gemini subscription, on a local Ollama model with no account, or on any hosted model behind one API key.
Every enqueue logs its settings to a local SQLite database, identifying models and LoRAs by content hash rather than filename, so repeated combinations increment a reuse count and history queries can suggest sampler, scheduler, step, and CFG settings that already worked on that machine.
Features
- Generation: text-to-image with ControlNet and IP-Adapter conditioning, short video, 3D, audio, upscaling, and background removal from one entry point
- Workflow authoring: template creation, node edits, dry-run validation against missing nodes and models, Mermaid rendering, and a lossless compact DSL
- Workflow library: list, analyze, query, de-virtualize buses and subgraphs, slice a toggle-template pipeline, and extract a graph embedded in a PNG
- Queue control: non-blocking enqueue returning a prompt id, status, requeue, patch, cancel, and clear
- Model management: HuggingFace and Civitai search, tracked downloads, installed-model listings, removal, and extra search-path edits
- Custom nodes: Registry search and details, installation through comfy-cli or ComfyUI-Manager, and generated skill files per pack
- Diagnostics: filtered server logs, execution history with tracebacks and timing, and a one-call failure explanation naming the failed node, missing models, and missing node types
- Process and memory: stop, start, and restart ComfyUI preserving launch arguments, and free VRAM through the server’s own endpoint
- Claude Code plugin: 11 slash commands, 42 skills, 4 subagents, and 3 hooks including a VRAM watchdog and a save warning before shutdown
- Installer packs: manifests of custom nodes, model URLs, and a workflow that drive both an apply step and generated Windows and RunPod install scripts
- Panel agent: a ComfyUI sidebar agent that edits the live canvas, with spatial layout, rewind and rollback, a pending-message tray, and multi-tab sessions
- Generation tracker: a local SQLite log keyed by model and LoRA content hash that backs proven-setting suggestions and popularity counts
