ComfyUI MCP
简体中文
A universal Model Context Protocol server that lets MCP-capable
agents discover ComfyUI nodes, build and edit API workflows, run them, inspect the queue, retrieve
outputs, and optionally render the generated graph on an open ComfyUI canvas.
The core is agent-neutral. This repository also packages that same server and one portable Agent
Skill for Codex, Claude Code, Gemini CLI, Cursor, and GitHub Copilot CLI. The host adapters contain
only manifests and launch configuration; no agent gets a forked implementation.
Project status: alpha. The core workflow store, graph editing, validation, execution, and
canvas bridge are implemented. Test against a non-production ComfyUI installation before giving
an agent access to valuable models, paid nodes, or a shared GPU queue.
Agent plugins and built-in skill
The repository now includes skills/comfyui-workflow/SKILL.md. It teaches compatible agents how to
discover the live node schema, edit revisioned graphs, validate before execution, handle queue and
file operations safely, and report generated outputs. This is what makes an installed agent know
how to combine the MCP tools instead of seeing only a flat tool list.
| Host | Included adapter | Local install or test |
|---|
| Codex | .codex-plugin/plugin.json | codex plugin marketplace add yutianxiao6/comfyui-mcp, then codex plugin add comfyui-mcp@comfyui-mcp |
| Claude Code | .claude-plugin/plugin.json | claude --plugin-dir /absolute/path/to/comfyui-mcp |
| Gemini CLI | gemini-extension.json | gemini extensions link /absolute/path/to/comfyui-mcp |
| Cursor | .cursor-plugin/plugin.json | Link or copy into ~/.cursor/plugins/local/comfyui-mcp |
| GitHub Copilot CLI | .plugin/plugin.json | copilot plugins install /absolute/path/to/comfyui-mcp |
| Other MCP clients | Generic example | Register examples/mcp-client-config.example.json |
All adapters share the same Python server and skill. They use uv to start the bundled source, so
uv must be on PATH; the first launch may need to download Python dependencies. See
docs/agent-integrations.md for persistent install commands,
non-default ComfyUI URLs, explicit skill invocation, verification, and packaging details.
What it does
- Discovers installed core and custom node types through ComfyUI's live
/object_info schema.
- Searches model folders and workflow templates without putting huge responses in agent context.
- Imports, creates, versions, and edits ComfyUI API-format workflows.
- Adds and removes nodes, sets literal inputs, and connects or disconnects graph edges.
- Performs local graph checks and live validation against the connected ComfyUI instance.
- Submits workflows, applies one-run-only overrides, inspects queue/history, and interrupts jobs.
- Uploads allowed input images and downloads generated files to a managed output directory.
- Optionally mirrors an API workflow onto every open ComfyUI canvas through the bundled bridge.
- Supports local
stdio, Streamable HTTP, and legacy SSE MCP transports.
Architecture
MCP client (Codex, Claude, Cursor, custom agent, ...)
│
│ stdio / Streamable HTTP
▼
comfyui-mcp-server
┌───────────┴───────────┐
│ workflow store/editor │
│ typed MCP tools │
│ ComfyUI HTTP client │
└───────────┬───────────┘
│
ComfyUI HTTP API / WebSocket
│
┌───────────┴────────────┐
│ execution backend │
│ optional canvas bridge│
└────────────────────────┘
The execution backend and visual canvas are intentionally separate:
- ComfyUI's
/prompt endpoint accepts an API-format workflow and executes it headlessly.
- An API submission does not modify an already open browser canvas.
- The optional
comfyui_extension receives the same API workflow and reconstructs visible nodes,
widgets, and links on the canvas. Execution still uses the standard ComfyUI API.
See docs/architecture.md for the design and trust boundaries.
Requirements
- Python 3.11 or newer.
- A reachable local or remote ComfyUI server.
- An MCP client with
stdio, Streamable HTTP, or SSE support.
uv for the bundled agent-plugin launchers. It remains optional when the Python package is
installed manually and a generic MCP client launches comfyui-mcp directly.
ComfyUI defaults to http://127.0.0.1:8188, which is also this project's default.
Install from this repository
git clone https://github.com/yutianxiao6/comfyui-mcp.git
cd comfyui-mcp
uv sync
uv run comfyui-mcp --version
With regular Python tooling: