Sandbox
@artokun/comfyui-mcp

MCP server and ComfyUI panel for LLM control

This project connects ComfyUI to an MCP server and a live sidebar agent so an LLM can build workflows, run them, and inspect results. It supports local, LAN, VPS, and Comfy Cloud setups, plus a panel mode that drives the live canvas from Claude, ChatGPT, Gemini, or other backends.

737 stars120 forksTypeScriptUpdated 7d ago
Who it's for

Builders who want their agent to generate, edit, and run ComfyUI workflows from one control surface.

What it delivers

You can steer ComfyUI in natural language while the agent handles workflow setup, execution, and iteration.

What it does

MCP workflow control

Exposes tools for generating images, video, audio, and running or rerunning workflows through ComfyUI.

Live graph editing panel

Adds a sidebar agent that edits the current ComfyUI graph, loads packs, and manages workflow state.

Claude Code plugin

Ships slash commands, skills, agents, and hooks for Claude Code users.

Skill and installer packs

Bundles model guides, troubleshooting skills, and one-command installer packs under `packs/`.

Remote connector mode

Can run as an authenticated Streamable HTTP server for remote clients with `--tunnel`.

How to get it

  1. 13. Start using it. With ComfyUI running, ask Claude to generate an image
    > Generate an image of a sunset over mountains
  2. 2To use comfyui-mcp from Claude Desktop's Custom Connectors or any remote client, like…
    npx -y comfyui-mcp@latest --tunnel
  3. 3Run
    # In Claude Code
    /plugin marketplace add artokun/comfyui-mcp
    /plugin install comfy
  4. 4Run
    > /comfy:install comfyui-impact-pack
  5. 5Run
    git clone https://github.com/artokun/comfyui-mcp.git
    cd comfyui-mcp
    npm install

README

comfyui-mcp — drive ComfyUI with ANY LLM

[!IMPORTANT] This project is no longer maintained.

ComfyUI now ships official agent and MCP tooling — Comfy Agent and Comfy MCP — built and supported by the Comfy-Org team with deeper integration than a community project can match. If you’re looking for an MCP server or AI agent for ComfyUI, use the official tooling.

This repo will remain public as a reference, but no new features, bug fixes, or dependency updates will be made. Issues and pull requests close when the repo is archived on 2026-10-09. The community Discord goes read-only the same day, with its threads left up as a searchable archive.

Thanks to everyone who used, starred, forked, and contributed to this project. It was a good run. :rocket:

The full story is in the goodbye post.

Looking for a ComfyUI or generative-AI integration expert? I take on custom solutions — reach me by email at art.longbottom.jr@gmail.com or on LinkedIn.

The Agent panel driving ComfyUI end to end. Click to watch the demo

The Agent panel driving ComfyUI end to end. It reads what is installed locally, wires the graph, frees VRAM, and runs the render.
Watch the 76s demo →

The local-first, agent-native control plane for ComfyUI. An MCP server plus a live sidebar agent that generates images, video and audio, authors and runs workflows, manages models and custom nodes, and edits your live ComfyUI graph in natural language. Bring whatever model you have: Claude or ChatGPT on your subscription, Gemini on your Google login, a free local model via Ollama (fully offline), or any hosted model over one API key (DeepSeek, GLM, MiMo, Kimi, GPT, Claude via OpenRouter). The tools and the panel are the same on every tier, and the built-in LLM Arena scores each model on real ComfyUI tasks so you know what yours can do. One config targets local installs, LAN, VPS, or Comfy Cloud.

npm version Node.js License Documentation

comfyui-mcp MCP server comfyui-mcp MCP server

Deploy on RunPod Join the Discord  One-click GPU pod. A ready-to-run ComfyUI with this project + Agent Panel + ComfyUI-Manager v2 preinstalled, on your own GPU. No setup.

Works on macOS, Linux, and Windows. Auto-detects your ComfyUI installation and port.

Stuck or have a question? Join the Discord for help, model tips, and release announcements.

38 MCP tools | 42 AI skills (Flux · WAN · LTX 2.3 video · MiniMax H3 · Qwen · Z-Image · Ideogram 4 · ERNIE · ANIMA · model registry · Civitai · node authoring · launch/perf flags) | 56 installer packs | 11 slash commands | 4 autonomous agents | 3 hooks

The plugin ships skills that grow with every release: model-specific generation guides with curated download URLs, workflow recipes, troubleshooting, and custom-node authoring. With them, Claude knows the right sampler, CFG, resolution, and model files for each architecture without trial and error.

Now available: the ComfyUI Agent Panel on ComfyUI-Manager & the Comfy Registry

An autonomous AI agent in your ComfyUI sidebar, running on Claude, ChatGPT, Gemini, or ANY local/hosted LLM (Ollama and every OpenAI-compatible endpoint). Subscriptions work with no API key; local models work with no account at all. Pick a provider and it drives your live graph: edits, spatial layout, one-shot workflow/pack loads, rewind/rollback, a pending-message tray, activity cards, multi-tab. It asks before spending paid API credits. Search comfyui-agent-panel in ComfyUI-Manager to install. Read more →

Full documentation: comfyui-mcp.artokun.io/docs


Quick Start

1. Install ComfyUI (if you haven't already): ComfyUI Desktop or from source

2. Add the MCP server to your Claude Code config (~/.claude/settings.json):

{
  "mcpServers": {
    "comfyui": {
      "command": "npx",
      "args": ["-y", "comfyui-mcp"],
      "env": {
        "CIVITAI_API_TOKEN": ""
      }
    }
  }
}

3. Start using it. With ComfyUI running, ask Claude to generate an image:

> Generate an image of a sunset over mountains

Claude will find (or download) a checkpoint, build a workflow, execute it, and return the image.

Note: This runs as a standalone MCP server, so there is no need to clone this repo. npx downloads and runs it.

Scope: local, remote, or Comfy Cloud

comfyui-mcp is local-first. A self-hosted ComfyUI on Mac/Linux/Windows is the primary target, and the same agent reaches remote installs (RunPod, VPS, LAN, reverse-proxied) from one config. Local-first, not local-only.

More than a bridge. Most ComfyUI MCP servers are thin connectors. They forward a prompt and hand back an image. comfyui-mcp is a full control plane. It authors and edits the graph node by node, runs and iterates on workflows, manages models and custom nodes, and ships model-specific expertise (samplers, CFG, resolutions, curated model URLs) so the agent gets it right without trial and error. If you want a minimal local relay, a lightweight server is fine. If you want an agent that operates ComfyUI, that's this project.

For Comfy Cloud users, Comfy-Org ships its own agent tooling: Comfy Cloud MCP (public beta, hosted on Comfy Cloud GPUs), the Comfy In-App Agent (private alpha, inside Comfy Cloud), and a first-party Comfy Local MCP (private test, not publicly available yet), all maintained by the Comfy team. If you don't have a GPU or you want zero setup, that's the better path; go use it.

Where this project differs is that it runs on your install and your choice of model, including a free local one via Ollama with no account and no network at all. comfyui-mcp also includes a community cloud mode (set COMFYUI_API_KEY, see Deployment modes) so a single MCP can target all three deployment shapes from one config.

Local vs. Comfy Cloud agent is a side-by-side comparison, including when Comfy Cloud is the right answer. (Statuses above are as of July 2026. Comfy-Org ships fast, so check their docs for the current state.)

Remote / hosted connector (one command)

To use comfyui-mcp from Claude Desktop's Custom Connectors or any remote client, like Comfy's own cloud.comfy.org/mcp connector, run it as an authenticated, publicly reachable Streamable-HTTP server with one flag:

npx -y comfyui-mcp@latest --tunnel

This forces the HTTP transport, generates an auth token, opens a cloudflared quick tunnel, and prints a ready-to-paste https://…/mcp URL + token + Claude Desktop connector snippet. Auth accepts Authorization: Bearer <token> or X-API-Key: <token> (matching Comfy Cloud's convention). See the Remote / hosted connector guide for the full walkthrough and headless usage.

Auth is opt-in. With no COMFYUI_MCP_HTTP_TOKEN set and no --tunnel, the default stdio (and plain --http on loopback) behavior is unchanged. It stays open and local. OAuth (Comfy's browser sign-in flow) is a planned follow-up.


Claude Code Plugin

This package also ships as a Claude Code plugin that adds slash commands, skills, agents, and hooks on top of the MCP tools.

Install as a plugin

# In Claude Code
/plugin marketplace add artokun/comfyui-mcp
/plugin install comfy

Slash commands

CommandDescription
/comfy:gen <prompt>Generate an image from a text description — auto-selects checkpoint, builds workflow, returns image
/comfy:viz <workflow>Visualize a workflow as a Mermaid diagram with nodes grouped by category
/comfy:node-skill <pack>Generate a Claude skill for a custom node pack from Registry ID or GitHub URL
/comfy:debug [prompt_id]Diagnose why a workflow failed — reads history, logs, traces root cause, suggests fixes
/comfy:batch <prompt, params>Parameter sweep generation across cfg, sampler, steps, seed, etc.
/comfy:convert <file>Convert between UI format and API format workflows
/comfy:install <pack>Install a custom node pack — git clone, pip install, optional restart
/comfy:gallery [filter]Browse generated outputs with metadata — filter by date, count, or filename
/comfy:compare <a vs b>Diff two workflows side by side — shows added/removed nodes and changed parameters
/comfy:recipe <name> <prompt>Multi-step recipes: portrait, hires-fix, style-transfer, product-shot

Built-in skills

42 skills total: model-family guides (Flux, WAN, LTX 2.3, MiniMax H3, Qwen, Z-Image, Ideogram 4, ERNIE, ANIMA + anime / WAN / Z-Image LoRA training), the model-registry (curated download URLs), the civitai pairing skill, node authoring, the launch/performance-flags matrix, and the core four below. Full list on the plugin docs page.

Installer packs. packs/ bundles 13 one-command ComfyUI setups: ANIMA, Ideogram 4, LTX-2.3, ERNIE, WAN (animate / longer-videos / transparent), Qwen (image / image-edit), Z-Image (turbo / base / xy-plot) and artokun-flow (WAN Animate: replace / animate). Each is a manifest of custom nodes + model URLs + workflow that drives both apply_manifest and generated install-windows.bat / install-runpod.sh, with CI that validates every model link + payload size. See packs/README.md.

SkillDescription
comfyui-coreWorkflow format, node types, data flow patterns, pipeline architecture, MCP tool usage guide
prompt-engineeringCLIP weight syntax (word:1.3), BREAK tokens, embeddings, model-specific prompting for SD1.5/SDXL/Flux/SD3
troubleshootingCommon error catalog — OOM, dtype mismatches, missing nodes, NaN tensors, black images, CUDA errors, with VRAM estimates per model
model-compatibilityCompatibility matrix — loaders, resolutions, CFG, samplers, ControlNets, LoRAs, and VAEs per model family (SD1.5/SDXL/Turbo/Lightning/Flux/SD3/LTXV)

Agents

AgentModelDescription
comfy-explorerSonnetResearches custom node packs — reads docs, queries /object_info, generates skill files
comfy-debuggerSonnetAutonomously diagnoses workflow failures — gathers logs + history, identifies failing node, checks models + custom nodes, proposes and optionally applies fixes
comfy-optimizerSonnetAnalyzes workflows for performance — detects redundant nodes, VRAM waste, wrong CFG/steps for model family, precision issues, suggests optimizations
comfy-researcherSonnetDiscovers and ranks ComfyUI custom node packs for a stated image-generation problem

Hooks

EventTriggerAction
PreToolUseenqueue_workflowVRAM watchdog — checks GPU memory via /system_stats and warns if < 1GB free before execution
PreToolUserestart_comfyui (actions stop/restart)Save warning — prompts user to save unsaved workflow changes before stopping ComfyUI
PostToolUseAny comfyui toolJob completion notify — checks for completed jobs and injects completion summaries into the conversation

Background Scripts

ScriptDescription
monitor-progress.mjsProgress monitor — connects to ComfyUI's WebSocket for real-time step progress (e.g., step 5/14 (36%)). Run as a background Bash task after enqueuing workflows. Reports completion with output filenames, errors with node details. Replaces polling queue (action:"status") in a loop.

Panel agent (Claude · ChatGPT · Gemini · any local/hosted LLM)

Beyond the headless MCP server, this package ships the panel orchestrator that powers the ComfyUI Agent Panel, an autonomous agent embedded in ComfyUI's sidebar that drives the live canvas. It runs in the background on your own subscription (Claude or ChatGPT), started on demand by the panel's Connect button:

npx -y comfyui-mcp@latest connect

Drive a REMOTE ComfyUI from your own machine (connect)

When ComfyUI runs somewhere with no Node or agent (a RunPod pod, a cloud box) you can still run the agent on your machine and drive that remote ComfyUI. There is no agent login on the box and nothing to install or configure remotely:

npx -y comfyui-mcp@latest connect https://abcd1234-3000.proxy.runpod.net

This is sugar for --panel-orchestrator with COMFYUI_URL set from the URL. The orchestrator runs locally on your Claude/ChatGPT login and reaches the remote ComfyUI over its public proxy URL. For a remote HTTPS pod, connect opens a token-gated wss:// tunnel (via Cloudflare) to the local agent bridge and hands the pod's panel that URL, so the pod's HTTPS page reaches your machine with no browser prompt, in any browser. A secure page can't open a plain ws:// socket to your box because of mixed-content and Private Network Access rules. A local ComfyUI uses the plain ws://127.0.0.1:9199 loopback bridge. Add --insecure-bridge to force that loopback for a remote pod, then arrange your own path to it, e.g. an SSH port-forward. Either way the panel JS runs in your local browser, and the agent and your login run only on your machine, so nothing is installed remotely.

To finish, with connect still running on your machine, open the remote ComfyUI in your browser and click Connect in the Agent panel. The panel is a pure-frontend extension. It links to the bridge your connect process is already serving, rather than asking the ComfyUI host to spawn an orchestrator it cannot run.

Multi-provider, full parity. The orchestrator depends on a provider-neutral AgentBackend port (dependency injection), with two adapters:

  • ClaudeBackend wraps the Claude Agent SDK (@anthropic-ai/claude-agent-sdk), a persistent streaming session over the claude.ai subscription (OAuth, no key).
  • CodexBackend wraps OpenAI Codex over the codex app-server JSON-RPC protocol (@openai/codex), on the ChatGPT subscription (codex login, no key).

Further adapters follow the same port: Gemini CLI (ACP), Antigravity (agy, the Google AI Pro/Ultra subscription path; install from antigravity.google and run agy once to sign in), Grok, Kimi, GLM, Ollama/LM Studio/llama.cpp (local), OpenRouter, and any OpenAI-compatible endpoint. See docs/backends for the full matrix.

Both are optional dependencies, and the panel picks a provider, not a port. Each backend runs its own orchestrator on its own loopback bridge port. A capability matrix tells the panel which features each backend supports (e.g. conversation-rollback is Claude-only today, since the Codex app-server resumes whole threads only).

The live-canvas tools and model knowledge are identical across providers. The panel_* tool definitions live in one shared list, registered onto both the in-process Claude SDK MCP server and a @modelcontextprotocol/sdk server over a loopback streamable-HTTP MCP that the orchestrator hosts for Codex (which can only host config-declared MCP servers). The headless comfyui MCP is likewise injected into both, in-process for Claude and declared via codex app-server -c mcp_servers for ChatGPT, so generation, models, and workflow tools are the same everywhere.

New tools that give every backend the same expertise and a cost guardrail:

ToolDescription
list_packs (action: "skill_list" / "skill_read")Discover and read bundled model-family + workflow skills — the knowledge Claude loads natively, exposed to any MCP client (e.g. the Codex backend)
list_packs (action: "list" / "read_workflow")List one-command installer packs (custom nodes + weights + ready workflow; all local-GPU / free) and read a pack's graph
list_packs (action: "list_templates")List the connected ComfyUI's custom-node-contributed workflow templates
list_packs (action: "check_runtime")Classify a workflow as local (your GPU, free) or api / mixed / unknown (hosted API nodes = paid credits) so the agent asks before spending paid API credits
list_packs (action: "extract_deps" / "install_deps")Work out which custom node packs a workflow needs, and install the missing ones through ComfyUI-Manager
panel_load_workflow(panel tool) Load a full workflow onto the live canvas in one shot — by bundled pack name (read server-side, never shuttled through chat) or by graph JSON
panel_strip_workflow / panel_slice_workflow(panel tools) De-virtualize a tangled graph (Get/Set buses, Reroutes, subgraphs, bypass → real connections) or carve one rgthree-toggled pipeline out of a monolith — by pack, server-side path, or inline graph; for understanding/rebuilding expert workflows without hand-tracing

MCP Tools

38 tools across workflow execution, generation, iteration, composition, models, and more:

Image Generation (high-level)

ToolDescription
generate_image action: "image"Generate from a text prompt — builds a txt2img workflow, fills unspecified params from your defaults, auto-selects a checkpoint
generate_image action: "controlnet"Generate conditioned by a ControlNet image (pose/depth/canny/normal) + prompt
generate_image action: "ip_adapter"Generate guided by a reference image's style/subject via IP-Adapter (needs ComfyUI_IPAdapter_plus)
generate_image action: "video" / "3d"Generate a short video clip (LTX-2.3, local GPU) or a 3D model (hosted partner API nodes) from the same one-line entry point
generate_image action: "upscale"Post-process an uploaded or staged image with ESRGAN super-resolution
generate_image (action:"remove_background")Post-process an uploaded or staged image into a transparent BiRefNet cutout

Audio Generation (high-level)

ToolDescription
generate_image action: "audio"Generate audio from a text prompt — supports ACE Step 1.5 (music with lyrics/structure) and Stable Audio 3 (music, instruments, SFX); auto-selects local models

Assets & Iteration

ToolDescription
get_image (action:"view")Return a generated asset's bytes as an inline image so the agent can see the result
get_image (action:"analyze_color")Palette / contrast / color statistics for a generated image (dominant colors, average + luminance stats, contrast checks) so the agent can reason about color without a vision round-trip
generate_image (action:"regenerate")Re-run the workflow that produced an asset_id, with optional parameter overrides
get_image (action:"list_assets")Browse recently generated assets (newest-first) by asset_id
get_image (action:"asset_metadata")Full provenance for an asset, including the originating workflow

Defaults

ToolDescription
get_defaults action:"get"Show merged generation defaults with per-source attribution
get_defaults action:"set"Update runtime defaults; persist: true writes the config file
get_defaults action:"get_ui" / action:"set_ui"Read/write ComfyUI's OWN frontend UI settings (the Comfy.* ids) — a separate store from the generation defaults above

Workflow Execution

ToolDescription
enqueue_workflow action: "enqueue"Submit a workflow (API format JSON) — returns prompt_id immediately, non-blocking
enqueue_workflow action: "rerun" / "run_url" / "template_schema"Re-run a past generation, or read/run a shared workflow from a URL, or inspect a bundled template's overridable slots
enqueue_workflow (action:"run_template")One-shot: resolve a bundled pack's expert graph, apply <nodeId>.<widget> overrides, and enqueue it
queueOne action-parameterized tool for the execution queue: list (running + pending), status (one job by prompt ID), get_workflow (a pending job's full payload), move/edit (requeue a pending job front/back, patched or replaced, with a new prompt ID), cancel (interrupt the running job — escalates interrupt → verify → /free, reports WEDGED if it won't die; clear_pending: true also drops all pending), cancel_queued, clear
get_system_statsGet system info — GPU, VRAM, Python version, OS

Workflow Visualization

ToolDescription
visualize_workflowOne action-parameterized tool for rendering and converting a workflow you pass in: render (Mermaid flowchart, nodes grouped by category), render_hierarchical (the same graph sectioned — overview, one section in detail, a listing, or an AI-oriented summary), mermaid (a Mermaid diagram back to executable workflow JSON), to_dsl/from_dsl (the compact, losslessly round-tripping authoring DSL)

Workflow Composition

ToolDescription
create_workflowOne action-parameterized tool for authoring: create (from templates: txt2img, img2img, upscale, inpaint, controlnet, ip_adapter, ace_step_15, stable_audio_3), modify (operations: set_input, add_node, remove_node, connect, insert_between), validate (dry-run — missing nodes, broken connections, invalid output indices, missing model files), node_info (query available node types from ComfyUI's /object_info endpoint)

Workflow Library

ToolDescription
get_workflowOne action-parameterized tool for READING a saved workflow file: list (the user library, subfolders included), get (one workflow's JSON by filename), analyze (a structured summary instead of raw JSON), query (filter/traverse/aggregate a big graph without dumping it), `s

Files in the repo

Repository payload25 top-level entries
  • .claude-plugin
  • .github
  • assets
  • docs
  • locales
  • packs
  • plugin
  • scripts
  • src
  • .env.example
  • .gitattributes
  • .gitignore
  • .npmignore
  • CHANGELOG.md
  • CONTRIBUTING.md
  • glama.json
  • LICENSE
  • llms-install.md
  • package-lock.json
  • package.json
  • README.md
  • server.json
  • tsconfig.json
  • vitest.config.ts
  • vitest.global-setup.ts

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k
t8y2/dbxConnectors

20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。

19k