comfyui-mcp

Control a ComfyUI install: build and run workflows, fetch models, manage nodes and VRAM

By Arthur R Longbottom (individual) TypeScript Local · stdio MediaAI and ML

78 popularity score ★ 897 ↓ 12k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add comfyui -- npx -y comfyui-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "comfyui": {
      "command": "npx",
      "args": [
        "-y",
        "comfyui-mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "comfyui": {
      "command": "npx",
      "args": [
        "-y",
        "comfyui-mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "comfyui": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "comfyui-mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.comfyui]
command = "npx"
args = ["-y", "comfyui-mcp"]
Gemini CLITerminal
gemini mcp add --scope user comfyui npx -- -y comfyui-mcp

Settings 12

COMFYUI_URL Optional: Full URL of the ComfyUI to drive; a non-loopback host switches to remote mode and skips auto-detection.
COMFYUI_PATH Optional: ComfyUI data directory (models, input, output) when auto-detection fails.
COMFYUI_PORT Optional: ComfyUI port; otherwise the configured port, 8188 and 8000 are tried.
COMFYUI_API_KEY secret Optional: Comfy Cloud API key; setting it switches to cloud mode against cloud.comfy.org.
COMFYUI_AUTH_TOKEN secret Optional: Token sent to a self-hosted ComfyUI behind a reverse proxy or gateway.
COMFY_API_KEY secret Optional: Comfy.org key for hosted partner API nodes; read from ~/.comfy-api-key when unset. For list_api_nodes.
CIVITAI_API_TOKEN secret Optional: Civitai token for model downloads. For download_model.
HF_TOKEN secret Optional: HuggingFace token for gated models and higher rate limits; HUGGINGFACE_TOKEN is read as a fallback. For download_model.
GITHUB_TOKEN secret Optional: GitHub token for skill generation, to avoid rate limits.
COMFYUI_MCP_HTTP_TOKEN secret Optional: Bearer token required by the HTTP transport; the endpoint is open when unset.
COMFYUI_MCP_TOOL_MODE Optional: Set to compact to expose only the three meta-tools, for small local models. Default full.
COMFYUI_MCP_AUTOUPDATE Optional: Set to 0 to stop the package checking npm and updating itself on load.

What it does

This server hands an MCP client the controls of a running ComfyUI. Sending a prompt and getting a picture back is the small part. The client can also build a workflow graph node by node, validate and queue the graph, then read history and tracebacks to work out why a run failed, or re-run an old generation with new settings. Single-call generation covers text-to-image, ControlNet, IP-Adapter, upscaling, background removal, short video, audio and 3D.

A second set of tools looks after the install. They search HuggingFace and Civitai and put weights in the right model folder, delete model files, install or bisect custom node packs, take snapshots through ComfyUI-Manager, restart the ComfyUI process, free VRAM, and can install ComfyUI from nothing. There are also tools for LoRA training in Docker, RunPod GPU pods, publishing a node pack of your own, and a local SQLite log of past runs used to suggest settings that worked.

Local is the default target, with the ComfyUI folder and port found automatically. Pointing at a remote or proxied ComfyUI, or at Comfy Cloud with an API key, turns the file and process tools off. Transport is stdio, or streamable HTTP on request with an optional Cloudflare tunnel and bearer token. The npm package also ships a Claude Code plugin and the back end for the ComfyUI Agent Panel.

Two details are in the startup code but not the README. You get 38 tools by default, plus list_tools, describe_tool and call_tool as a fallback layer; COMFYUI_MCP_NO_FACADE=1 removes those meta-tools and COMFYUI_MCP_TOOL_MODE=compact leaves only them. On every load the package asks npm for a newer release, and for global or local installs it updates itself on disk unless COMFYUI_MCP_AUTOUPDATE=0 is set. The disabled report_issue tool describes the project as getting limited maintenance for critical fixes, a note the README has since removed.

What it needs

RuntimeNode.js 22+
Runs onmacOS, Windows, Linux
ComfyUIYour own instanceA local or reachable remote ComfyUI to drive; Comfy Cloud with an API key works instead
Also
  • A running ComfyUI instance
  • A GPU for local rendering
  • comfy-cli 1.11.1+ on PATH for the comfy_cli tool
  • Docker with NVIDIA GPU passthrough for LoRA training

Optional extras need their own keys: a RunPod account and key for the pod tools, and Civitai or HuggingFace tokens for some model downloads. comfy-cli is installed separately (see the comfy-cli docs) and found on PATH or through COMFY_CLI_PATH.

Limits

  • Limit report_issue is disabled: it files nothing and returns a notice that the project gets limited maintenance for critical fixes
  • Not covered In remote and Comfy Cloud modes the local file and process tools are unavailable; in cloud mode WebSocket tools fail with CLOUD_UNSUPPORTED
  • Early release The restart_comfyui status action and the refusal of start on Windows are documented in the README but not in the published release yet
  • Platform node_pack and the start and stop actions of restart_comfyui work on local installs only
  • Limit The connected model must support tool calling, and without vision it cannot look at its own outputs
  • Cost Hosted partner API nodes need a Comfy account with credits, and RunPod pods are billed while they run
  • Limit HTTP auth is opt-in on loopback and OAuth is not supported; a non-loopback host without a token is refused unless COMFYUI_MCP_ALLOW_UNAUTH=1

Limited maintenance only: critical fixes, no broad roadmap, and the report_issue tool is disabled. In remote and Comfy Cloud modes the local file and process tools are unavailable, and in cloud mode WebSocket tools fail with CLOUD_UNSUPPORTED. The connected model must support tool calling; without vision it cannot see its own outputs. Hosted partner API nodes and RunPod pods cost money. node_pack works on local installs only. HTTP auth is opt-in and OAuth is not yet supported.

Who it suits

Suits people who run their own ComfyUI and want an assistant to operate it end to end, including installing models and nodes and restarting the server. That reach means it writes to disk, runs processes and updates its own package, so it fits a machine you control. Pick it when you want to use your own models, including offline local ones. Its README points people with no GPU, or who want a hosted option with no setup, to Comfy-Org's own Comfy Cloud MCP instead. If you only need a simple prompt-to-image relay, a smaller server with fewer write tools carries less reach.

Tools 41

11 only read, 26 change things, 4 can delete or overwrite. A ? marks an optional parameter.

generate_image changes
One-call generation: text-to-image, ControlNet, IP-Adapter, video, 3D, audio, upscale, background removal, regenerate
get_image
View, list and inspect generated assets and outputs, with colour statistics and provenance
upload_image changes
Put a local image into ComfyUI's input folder or stage files for later steps
get_defaults changes
Read or change generation defaults and ComfyUI's own UI settings
enqueue_workflow changes
Submit an API-format workflow, re-run a past job, run one from a URL or a bundled template
queue changes
List, inspect, reorder, edit, cancel or clear jobs in the execution queue
batch changes
Submit and track many workflows or a parameter sweep under one batch id
get_system_stats
Report GPU, VRAM, Python and OS details, and read ComfyUI server logs
visualize_workflow
Render a workflow as a Mermaid diagram and convert between JSON, Mermaid and a compact DSL
create_workflow changes
Build workflows from templates, edit nodes and links, validate them, query node types
get_workflow
Read, summarise, query or flatten saved workflow files, or pull a workflow out of a PNG
save_workflow changes
Save workflows to the library and record or check a model and node-pack lock
download_model changes
Search HuggingFace and Civitai and download model weights into the right folder
list_local_models deletes
List installed models, delete model files, and edit extra model search paths
model_metadata changes
Read and curate the metadata embedded in a .safetensors model file
apply_manifest changes
Apply a setup manifest: custom nodes, model downloads and pip packages in one go
clear_vram changes
Unload cached models to free GPU memory and report before and after
search_custom_nodes
Search the ComfyUI Registry for node packs or get one pack's details
install_custom_node deletes
Install, update, repair, enable, disable or remove custom node packs
node_snapshot changes
List, save and restore custom-node snapshots through ComfyUI-Manager
bisect changes
Binary-search installed custom nodes by toggling them to find the one causing a fault
node_pack changes
Scaffold, edit, test and publish your own custom-node pack on a local install
list_packs changes
Read bundled skills and installer packs, check whether a workflow uses paid API nodes, install its dependencies
list_api_nodes changes
List and run hosted partner API nodes, which need a Comfy account and credits
comfy_cli changes
Drive the official comfy-cli: server start and stop, jobs, node search, models, transfers
kitchen changes
Check comfy-kitchen acceleration on this GPU and apply faster settings to a graph
get_history
Read run history and tracebacks, diagnose failures, and suggest settings from past runs
restart_comfyui deletes
Stop, start or restart the local ComfyUI process with its saved launch arguments; a stop drops queued workaction: enum
install_comfyui changes
Install, update and configure a local ComfyUI, its sidebar panel and this server
workspace changes
Show and manage which local ComfyUI installation is in use
apps changes
List and run named one-click workflow apps registered on this ComfyUI
runpod changes
Create, start, stop and connect to RunPod GPU pods; creating and running pods costs money
runpod_watch
Watch a RunPod pod's live status or diagnose why it is not usable
train_doctor changes
Check and set up the Docker and GPU machinery that LoRA training needs
train_prepare_dataset changes
Stage and caption training images into a named dataset
train_start deletes
Launch, poll, stop and delete LoRA training jobs locally or on a pod
calculate
Evaluate maths expressions exactly, without needing ComfyUI
report_issue
Disabled: files nothing and only returns the reporting statustitle: stringbody: stringrepo?: stringlabels?: array
list_tools
Meta-tool listing the catalogue of tools, offered beside the full set unless COMFYUI_MCP_NO_FACADE=1
describe_tool
Meta-tool returning one tool's input schema
call_tool changes
Meta-tool that runs any catalogued tool by name

Similar servers