← Back to directory
C

Comfy MCP

Official
Drive the ComfyUI on your own machine from AI agents
GitHub source repository ↗
★ 212 Stars Category · Other Very popular
69FMRS · C

Comfy MCP is an officially maintained, local-first MCP server from Comfy-Org built on comfy-cli. It runs as a stdio subprocess of your client and drives the ComfyUI on your own machine, covering generation, job monitoring, output collection, live introspection of your installed nodes/models/templates, and workflow validation and management. It is local-first but not local-only: partner models run on partner infrastructure, and COMFYUI_URL can target a machine you control. It has no path to Comfy Cloud, so tie into the separate remote HTTP server for cloud GPU execution. It needs Python >= 3.10 and comfy-cli >= 1.14.0, is beta, and exposes around 40 tools. It suits users with local inference hardware who want to automate a local ComfyUI from an AI client; credit spend, network exposure and local environment changes are the main risks, each behind a confirmation gate that still deserves careful authorization.

Reliability
10/20
Security and permissions
15/20
Maintenance
13/20
Documentation
17/20
Setup experience
14/20
Read the FMRS scoring method →

Comfy MCP is a local MCP server maintained by Comfy-Org and built on comfy-cli. It is launched as a stdio subprocess by your AI client and drives the ComfyUI installed on your own machine (default 127.0.0.1:8188, or one on another machine you control via COMFYUI_URL / COMFYUI_HOST). It can generate images, submit and monitor jobs asynchronously, surface failure verdicts, collect output PNGs, introspect the nodes/models/templates your live install actually has, validate and edit workflows, and launch/stop/restart ComfyUI and tail its logs. Every tool shells out to the comfy command with --where local --json and parses comfy-cli's envelope/1 output. It requires Python >= 3.10, comfy-cli >= 1.14.0, a ComfyUI workspace and a running ComfyUI. It is currently beta, with 40 tools. Note it has no path to Comfy Cloud; for cloud-hosted execution use the separate remote HTTP server at https://cloud.comfy.org/mcp.

Tools

server_info
Confirm the local ComfyUI is running and report workspace, Python environment, hardware and freshness
run_workflow
Run a workflow JSON (API-format or UI export), optionally submitting async then waiting, watching or cancelling
generate_image
Text prompt to image in one call, running the gallery's default text-to-image template
run_template
Run a gallery template; paid templates require confirm_spend
fetch_outputs
Collect a finished job's outputs by prompt_id, optionally copying them to a chosen directory
job
Submit/read job state, queue, wait or cancel
search_templates
Search the template gallery, filterable by tag and type
fetch_template
Fetch a template and write a runnable workflow JSON, with a local_check compatibility report
get_template
Read a template with a local_check compatibility report
search_models
Search available models, including a cross-folder walk
download_model
Download a model into this machine's models dir; refuses when a remote ComfyUI is configured unless shared storage is asserted
download
Manage already-submitted downloads and their status
upload_file
Stage a local file as an input asset on the target ComfyUI
nodes
Introspect nodes on the live ComfyUI, custom nodes included
node_dependencies
Inspect node dependencies
validate_workflow
Validate a workflow graph against the current install
list_workflow_notes
List workflow notes
system_stats
Read per-device vram_free / vram_total from the live ComfyUI for VRAM coordination
free_memory
Ask ComfyUI to release the models it holds
launch_comfyui
Launch the ComfyUI server; --listen asks for confirmation
stop_comfyui
Stop the ComfyUI server
restart_comfyui
Restart the ComfyUI server; asks for confirmation when it must stop a server it did not start
update_comfyui
Update ComfyUI; target=all asks for confirmation
switch_comfyui_version
Switch ComfyUI version; asks for confirmation
install_node
Install a node pack; asks for confirmation
get_logs
Read local ComfyUI logs
auth_login
Start the Comfy sign-in in the background and hand back the OAuth URL
auth_status
Confirm the sign-in state
partner_generate
Generate with hosted partner models; spends Comfy credits and is confirmed on every call
emit_partner_workflow
Only writes a graph containing a partner API node; never calls the partner and spends nothing

Setup

  1. Install the pieces: pip install comfy-mcp "comfy-cli>=1.14.0", then comfy install if you have no workspace (installing comfy-mcp does not install comfy-cli). 2. Launch ComfyUI and leave it running: comfy launch. 3. Register the server in your AI client with command comfy-mcp, setting COMFY_BIN (absolute path to the comfy binary) and optionally COMFY_API_KEY (needed only for partner-API nodes) in the env block; on Claude Code you can use claude mcp add comfy-mcp -e COMFY_BIN=... -- comfy-mcp. 4. Restart or reload the client so the tools appear, then have the agent call server_info to confirm ComfyUI is up before run_workflow / fetch_outputs.
claude_desktop_config.json
{
  "mcpServers": {
    "comfy-mcp": {
      "command": "comfy-mcp",
      "env": {
        "COMFY_BIN": "/path/to/venv/bin/comfy",
        "COMFY_API_KEY": "<your-comfy-api-key>"
      }
    }
  }
}

Fit and risk

Best for

  • Users whose machine can carry local diffusion (a discrete GPU with >= 24 GB VRAM is ideal; Apple Silicon with >= 32 GB unified memory is OK for images)
  • Users who want to automate a local ComfyUI workflow from Claude Code, Claude Desktop, Cursor or any MCP-speaking client
  • Users who need to introspect live nodes, models and templates, custom nodes included
  • Users running a local LLM and ComfyUI on the same GPU who need the read/free VRAM loop

Not for

  • Users who want Comfy Cloud execution, cloud queue or cross-session cloud batches — this server has no path to Comfy Cloud, use https://cloud.comfy.org/mcp instead
  • Machines with under 8 GB VRAM or a confirmed absence of a GPU (use partner nodes or the cloud MCP)
  • Users who need lifecycle management (launch/stop/update/version-switch/install nodes/logs) on a remote box — those tools are local-only
  • Users running the MCP on a remote or containerised host who need the browser sign-in callback to land on their machine

Required permissions

  • Runs the comfy command as a subprocess on your machine, carrying the server process's full environment
  • Reads ComfyUI workspace files, including workflow JSON and input assets
  • Writes generated outputs, by default into the ComfyUI workspace's output/ directory; fetch_outputs can copy them to a directory you name
  • Writes/installs models and node packs on this machine (download_model, install_node)
  • Reads, launches, stops or restarts the local ComfyUI process
  • launch_comfyui with --listen exposes an unauthenticated ComfyUI to the network and requires explicit confirmation
  • COMFY_API_KEY is used for partner-API nodes and can spend Comfy credits through those nodes
  • COMFY_MCP_ASSUME_CONSENT can pre-authorize the install_node, update_all, version_switch, kill_untracked and network_exposure gates (spending is excluded)

Risks and side effects

  • Partner generation (partner_generate, workflows or templates containing partner-API nodes) really spends Comfy credits and is confirmed at call time; an agent host's 'always allow this tool' toggle is never treated as spend consent
  • An arbitrary custom node can still call a paid service of its own — the confirm_spend gate only covers partner-API nodes comfy-cli recognizes, so check a workflow you did not build before running it
  • launch_comfyui with --listen binds an unauthenticated ComfyUI to your network, exposing it to others
  • Installing node packs, switching versions, updating ComfyUI and force-restarting a server it did not start modify your local environment; tools fail closed when the client does not show the confirmation prompt
  • With a remote COMFYUI_URL configured, system_stats / free_memory still act on the local install, so you may measure and free the wrong machine; the remote ComfyUI must be reachable and unauthenticated on that network
  • COMFY_MCP_ASSUME_CONSENT is a setting written in your client config; granting too much silently widens the risks above
  • The server is beta, so behaviour may change

Troubleshooting

  1. A tool call fails with 'comfy not found on PATH': that is a missing engine, not a broken install — install comfy-cli >= 1.14.0, or set COMFY_BIN to the absolute path in the client env block
  2. The server reports an out-of-date comfy-cli: it requires >= 1.14.0, and installing this server does not install comfy-cli, so install the two together or upgrade
  3. Verifying COMFY_LOCAL_URL took effect: call server_info first (it wraps comfy env); if it still reports :8188, check the env block placement, whether the client was restarted, whether the value is well-formed (only http is accepted), and the comfy-cli version; run COMFY_LOCAL_URL=<value> comfy env in a terminal to read the stderr warning
  4. No failure log appears: COMFY_LOCAL_MCP_DEBUG_LOG is no longer read, use COMFY_MCP_DEBUG_LOG; upgrading from comfy-local-mcp also changed the default log directory leaf to comfy-mcp/
  5. Operation not permitted on macOS: keep ComfyUI out of ~/Documents, ~/Desktop and ~/Downloads, or grant your client Full Disk Access
  6. Discovery succeeds but a template run fails: read the local_check block — runnable=false names missing node classes or model options, while checked=false usually means ComfyUI isn't running so there is no live catalog to compare against
  7. A partner node run fails with partner_node_requires_credential: set COMFY_API_KEY, sign in via auth_login, or store a key with comfy auth set comfy-cloud-api-key --key <KEY> (an MCP client does not inherit your shell's COMFY_API_KEY)
  8. A client does not show confirmation prompts: the tool fails closed and names the equivalent terminal command; you can pre-authorize a gate with COMFY_MCP_ASSUME_CONSENT
  9. Upgrading from comfy-local-mcp: pip uninstall comfy-local-mcp before installing comfy-mcp, change the client's command to comfy-mcp, and remove the leftover script pointing at the old package

Use cases

Have an AI agent run an existing workflow on your local ComfyUI and collect the generated images
Go from a text prompt to an image in one call
Submit jobs asynchronously, then wait, watch, cancel and read the failure verdict
Introspect the nodes, models and templates your install actually has rather than a static catalog
Validate a workflow graph, edit a template's slots and fan one workflow into variants
Manage local ComfyUI launch, stop, restart, logs and input asset staging

Supported clients

Claude CodeFull support
Claude DesktopFull support
CursorFull support