by Comfy-Org
Local MCP server for ComfyUI — run your local ComfyUI from AI agents
# Add to your Claude Code skills
git clone https://github.com/Comfy-Org/comfy-mcpcomfy-mcp is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Comfy-Org. Local MCP server for ComfyUI — run your local ComfyUI from AI agents. It has 386 GitHub stars.
comfy-mcp's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/Comfy-Org/comfy-mcp" and add it to your Claude Code skills directory (see the Installation section above).
comfy-mcp is primarily written in Python. It is open-source under Comfy-Org on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh comfy-mcp against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Drive your own ComfyUI from Claude Code, Claude Desktop, Cursor, or any MCP-speaking AI agent — an MCP server built on comfy-cli.
Looking for the cloud-hosted version? Comfy Cloud MCP is set up below — install it instead of this server, or alongside it.
What it does:
Each tool shells out to the comfy command with --where local --json, parses comfy-cli's
envelope/1 output, and returns it — comfy-cli is the engine, and by default everything targets
the ComfyUI on your machine (127.0.0.1:8188).
Scope — local-first, not local-only. A few flows already reach beyond your machine:
partner_generate runs hosted partner models
(Flux / Ideogram / Kling / …) entirely on partner infrastructure — no local ComfyUI in the
execution path — and partner-API nodes let a locally-executed workflow call
those same hosted models, while COMFYUI_URL points the run/job tools
at a ComfyUI on another machine you control.
This server vs. Comfy Cloud MCP. Two different servers, and running both is
normal. This one is stdio: your client launches it as a subprocess on your own machine, and
it drives the ComfyUI installed there (or one on another machine you control). Comfy Cloud MCP is a
remote HTTP server at https://cloud.comfy.org/mcp that your client connects to over the
network, and it executes workflows on Comfy Cloud GPUs — no local GPU, no ComfyUI install. Both
authenticate: this one signs in to Comfy through comfy-cli (auth_login or
COMFY_API_KEY), the cloud one through OAuth in your browser or a Comfy Cloud API key. Both can
spend credits on partner models, so partner generation is not the dividing line — what this
server has no path to is Comfy Cloud itself: no cloud-hosted execution, no cloud queue, no
cross-session cloud batches. Every tool here shells out to comfy --where local. Pick by where you
want the work to run, or install the cloud server too.
Status: beta. 42 tools; core loop validated end-to-end against a live local ComfyUI (
server_info → run_workflow → fetch_outputs→ PNG on disk). CI runs pytest + ruff on Python 3.10 and 3.14.
Four steps take you from a fresh install to your first generated image.
Install the pieces.
pip install comfy-mcp "comfy-cli>=1.14.0" # this server + the engine it wraps
comfy install # create a ComfyUI workspace (skip if you have one)
Both names, one command — on purpose. Installing comfy-mcp does not install
comfy-cli: it is not a declared dependency of this package, because the server runs whichever
comfy binary your PATH (or COMFY_BIN) resolves to, which is often not
the environment you installed the server into. Declaring it would put a second copy in this
venv that may not be the one your tools actually drive; the version that matters is checked at
runtime instead, against the binary really being called. Skip it and the server still
starts and completes the MCP handshake — every tool call then fails with "comfy not found on
PATH", which is a missing engine, not a broken install.
pip install comfy-mcp puts a comfy-mcp console script on your PATH; that command is what
you point your AI client at in step 3. (A dedicated venv is fine — MCP clients may not see that
venv's PATH, which is exactly what COMFY_BIN is for; see Prerequisites.)
comfy-mcp --version confirms it landed — but don't run comfy-mcp itself to test it: it
is a stdio server that talks MCP over stdin/stdout, so in a terminal it just waits and
exits without printing anything. comfy-mcp --help says the same thing in one screen.
To install from a checkout of this repo instead, run pip install . there (pip install -e .
for a working copy) — the comfy-cli half is the same either way.
Installed this server back when it was called
comfy-local-mcp? Do Upgrading fromcomfy-local-mcpfirst — installingcomfy-mcpalone will not clean up after the old name.
Launch ComfyUI and leave it running:
comfy launch
Add the server to your client using the snippet for your client in Configure your AI client just below, then restart / reload it so the tools appear.
Ask your agent to run a workflow. For example:
"Confirm my local ComfyUI is running, then run the workflow at
~/workflows/txt2img.jsonand show me the image."
Under the hood the agent calls server_info to confirm ComfyUI is up, run_workflow to
execute your workflow JSON (API-format or a UI export), and fetch_outputs to collect the
result. No hand-authored workflow? Ask it to start from a template instead — it can
search_templates, fetch_template to write a runnable JSON, and run that — and
fetch_template tells it up front if your install can't run that
template yet.
Where the images land. ComfyUI writes generated files into your ComfyUI workspace's
output/ directory (part of the workspace comfy install created). On top of that,
fetch_outputs(prompt_id, out_dir) copies a finished job's outputs into any directory you
name — so telling the agent "save them to ./outputs" puts a copy right where you asked while
the originals stay in the ComfyUI workspace.
For video or audio output, fetch_outputs(inline_images=True) records every output's on-disk
path, media type and size in structuredContent and inlines small audio clips directly as MCP
audio content, while a video — MCP has no video content type — and anything past the cap stays a
path-only record. For a visual summary of a video, pass the downloaded file to preview_media: it asks
comfy-cli to render a PNG contact sheet or waveform and returns that image inline, so the agent can
inspect the result without embedding the whole media file in the MCP response.
comfy-local-mcpThis server used to be called comfy-local-mcp. It was never published to PyPI under that
name, so this only affects you if you installed it from a source checkout — but for those installs
the rena