
Comfyui Mcp
io.github.artokun由 GitHub 账号 artokun 发布v0.52.206更新于 Nov 4, 2026
MCP server + Claude Code plugin for ComfyUI: run workflows, generate images, manage models & VRAM.
概览
面向 ComfyUI 的 MCP 服务器与 Claude Code 插件,让助手运行工作流、生成图像、管理模型与显存。
- 可以做什么
- 根据提示词生成图像、视频、3D 与音频,支持 ControlNet、IP-Adapter、放大与去背景
- 创建、修改、校验、可视化并转换工作流,提交、重跑或取消队列任务
- 读取、保存、剥离与切片已保存的工作流,并从 PNG 中提取内嵌工作流
- 搜索、下载、删除模型,管理搜索路径,释放 GPU 显存
- 搜索并安装自定义节点包,生成技能文件,调用官方 comfy-cli 命令
- 依据历史与日志诊断失败任务、推荐采样参数,并重启或停止 ComfyUI
- 适用场景
- 当你已在本机或远程主机上运行 ComfyUI,并希望助手端到端地操作它时适用:一句话生成图像、编写与调试工作流、管理模型与节点包,或做参数扫描与多步配方。
- 运行要求
- 通过 npx(Node.js)以 stdio 在本地运行;需要可访问的 ComfyUI,自动探测或由 COMFYUI_URL 指定。Civitai 下载可选 CIVITAI_API_TOKEN,社区云模式需 COMFYUI_API_KEY,官方 CLI 工具需 comfy-cli 1.11.1 以上(从 COMFY_CLI_PATH 或 PATH 解析)。--tunnel 模式会开启带生成令牌的公网 HTTPS 端点。
安装
在 SourceWeft 中
- 打开 控制台中的 Comfyui Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
comfyui-mcp — drive ComfyUI with ANY LLM
[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-panelin 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):
3. Start using it. With ComfyUI running, ask Claude to generate an image:
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.
npxdownloads 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:
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_TOKENset and no--tunnel, the default stdio (and plain--httpon 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
Slash commands
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 bothapply_manifestand generatedinstall-windows.bat/install-runpod.sh, with CI that validates every model link + payload size. Seepacks/README.md.
Agents
Hooks
Background Scripts
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:
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:
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:
ClaudeBackendwraps the Claude Agent SDK (@anthropic-ai/claude-agent-sdk), a persistent streaming session over the claude.ai subscription (OAuth, no key).CodexBackendwraps OpenAI Codex over thecodex app-serverJSON-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:
MCP Tools
38 tools across workflow execution, generation, iteration, composition, models, and more:
Image Generation (high-level)
Audio Generation (high-level)
Assets & Iteration
Defaults
Workflow Execution
Workflow Visualization
Workflow Composition
Workflow Library
Image Management
Model Management
Memory Management
Registry & Discovery
Official comfy-cli
Install comfy-cli 1.11.1 or newer to enable the official JSON-backed tools. The MCP resolves comfy from COMFY_CLI_PATH, PATH, or the selected workspace's .venv/venv. Local custom-node operations prefer comfy node when a supported CLI is available and otherwise fall back to Manager HTTP; remote targets keep using Manager HTTP.
Diagnostics
Process Control
Generation Tracker
Every enqueue_workflow call logs settings to a local SQLite database (generations.db). Repeated settings combos get a reuse_count bump instead of a duplicate row, so the count works as a popularity signal. The tracker identifies models and LoRAs by content hash (AutoV2 / SHA256), not filename, so renamed files still group together.
Examples
Generate an image
Claude will:
- Check installed checkpoints (download one if needed)
- Build a txt2img workflow with your prompt
- Execute it on ComfyUI
- Return the generated image
Visualize a workflow
Produces a Mermaid diagram with nodes grouped by category:
Debug a failed workflow
Reads the last execution history and logs, identifies the failing node, checks for missing models or node packs, and suggests a fix.
Diagnose a specific execution by prompt ID.
Parameter sweep
Generates a grid of images across all parameter combinations and presents a summary table with results.
Supported sweep parameters: cfg, steps, sampler, scheduler, seed, denoise, width, height.
Multi-step recipes
Runs two passes: txt2img at 512x768, then an img2img upscale to 1024x1536 that adds detail.
Available recipes:
Convert workflow format
Converts between ComfyUI's UI format (nodes + links arrays) and API format (node IDs → {class_type, inputs}).
Install a custom node pack
Searches the registry, shows details, clones the repo to custom_nodes/, installs dependencies, and offers to restart ComfyUI.
Browse output gallery
Lists recent outputs with their embedded metadata: checkpoint, prompt, seed, steps, CFG, and sampler for each image.
Compare workflows
Shows added/removed nodes, changed parameters (old → new values), and optional Mermaid diagrams for visual comparison.
Validate before running
Checks for missing node types, broken connections, invalid output indices, and missing model files without executing the workflow.
Manage models
Manage VRAM
Extract workflow from an image
Reads the PNG metadata chunks to recover the exact workflow and prompt used to generate the image.
Explore custom nodes
Generates a skill file documenting every node, its inputs/outputs, and usage patterns.
Process control
Configuration
The server auto-detects your ComfyUI installation and port. Override with environment variables if needed.
Where to put keys and overrides:
- Panel users. Use the API Keys card (▾ menu next to "connected"). Keys are stored in
~/.comfyui-mcp/panel-secrets.jsonand take effect without a restart. - MCP-only setups (Claude Desktop, Claude Code, etc.). Use the
envblock of your MCP client config, as shown in the setup examples above. - Real environment variables always take precedence over stored keys. For development, the server also loads
~/.comfyui-mcp/.envas an override file; regular installs shouldn't need it.
Deployment modes
comfyui-mcp operates in one of three modes, auto-selected from the environment:
Some setups (e.g. dstack driving ComfyUI on RunPod) port-forward
a remote ComfyUI back to localhost:8188, so the loopback check above reports a
local install that isn't one. Pass --force-remote (or set
COMFYUI_MCP_FORCE_REMOTE=1) alongside --comfyui-url/COMFYUI_URL to force
remote mode regardless of hostname:
Transports
The server speaks stdio by default, which is what Claude Code, Claude Desktop, and the MCP Inspector expect, so no flags are needed. For MCP gateways, remote/hosted setups, or fetch-based clients, opt into streamable-HTTP:
Other agents & local LLMs (Hermes, OpenClaw, Copilot CLI, Ollama)
comfyui-mcp supports non-Claude harnesses. One command writes the server entry into the harness's own config (it merges into an existing file rather than overwriting it):
Model requirements. Tool calling is a hard requirement; a model without tool calling doesn't work. Thinking and vision are recommended. Without thinking, multi-step tool chains degrade; without vision the agent can generate but can't see its own outputs.
Compact tool mode. --compact /
COMFYUI_MCP_TOOL_MODE=compact registers 3 meta-tools (list_tools →
describe_tool → call_tool) instead of the direct tool set, pulling schemas
into context one tool at a time. That is the right trade for small local models. The
direct tool set is the default and is what frontier-model harnesses want.
Run it locally
for free with our fine-tuned models. ollama pull artokun/gemma4-comfyui-mcp:e4b
(also :e2b for ~2 GB VRAM, :12b for ~8 GB) is Gemma 4, QLoRA-trained on 1,055
server-verified trajectories over the full comfyui-mcp tool set, and is the
panel's Ollama default. Stock gemma4:*/qwen3:4b are also validated end-to-end
(npm run test:local-llm); gemma3 has no native tool calling and is
unsupported. The full guide, covering hosted-model guidance (DeepSeek/MiMo/GLM class),
per-harness setup, and troubleshooting, is
Local LLMs & other agents.
Remote ComfyUI
Point the server at a ComfyUI running anywhere; no local install is required:
Behind a reverse proxy / API gateway (path prefix + auth header). For a
self-hosted ComfyUI exposed under a prefixed route with its own auth layer (this
is not Comfy Cloud, which is COMFYUI_API_KEY):
Auto-detection
Port: Probes 8188 (CLI default) then 8000 (Desktop app default) via /system_stats.
Path: Checks common locations in order:
~/Documents/ComfyUI(macOS/Windows Desktop app data directory)~/Library/Application Support/ComfyUI(macOS)~/AppData/Local/Programs/ComfyUI/resources/ComfyUI(Windows Desktop app install)~/AppData/Local/ComfyUI(Windows)~/ComfyUI,~/code/ComfyUI,~/projects/ComfyUI,~/src/ComfyUI/opt/ComfyUI,~/.local/share/ComfyUI(Linux)- Scans
~/Documentsand~/My Documentsfor any directory containing "ComfyUI"
Set COMFYUI_PATH to skip detection and use an explicit path.
How It Works
The server communicates with ComfyUI through its REST API and WebSocket interface:
- WebSocket. Enqueue workflows, receive real-time progress updates (step by step via the background monitor script), get execution results
- REST API. System stats, node definitions (
/object_info), logs, history, queue management, workflow library, VRAM control (/free), embeddings - File system. Read/write the models directory, detect installation paths, upload images, extract PNG metadata, browse outputs
- External APIs. HuggingFace (model search), ComfyUI Registry (custom node discovery), GitHub (skill generation), CivitAI (model downloads)
All communication with the MCP client (Claude Code) happens over stdio using the Model Context Protocol. Logs go to stderr so they never mix into the protocol stream.
Development
Prerequisites
Setup
Scripts
Local testing with Claude Code
Point Claude Code at your local build instead of the npm package:
Or test the plugin directly:
Project structure
Troubleshooting
"ComfyUI not detected on ports 8188, 8000"
Make sure ComfyUI is running. The Desktop app uses port 8000 by default; the CLI uses 8188. Set COMFYUI_PORT if you're using a custom port.
"COMFYUI_PATH is not configured"
The auto-detection couldn't find your ComfyUI data directory. Set COMFYUI_PATH to the directory containing your models/ folder (e.g., ~/Documents/ComfyUI).
"Multiple ComfyUI installations detected"
This is informational. The server uses the first one found. Set COMFYUI_PATH to pick a specific installation.
Model downloads fail
For HuggingFace gated models, set HUGGINGFACE_TOKEN. For CivitAI, set CIVITAI_API_TOKEN.
Workflow execution errors
Use /comfy:debug to diagnose failures. Or call get_history (action: "diagnose") / get_system_stats (action:"logs") directly to see the full error messages, including Python tracebacks from ComfyUI.
Out of memory (OOM)
Use clear_vram to free GPU memory before running large workflows. The VRAM watchdog hook warns you when less than 1GB is free before a workflow runs. See the troubleshooting skill for model-specific VRAM estimates.
Missing custom nodes
Use /comfy:install <pack> to install missing node packs from the registry. The debug command detects missing packs and suggests them.
Contributing
Contributions are welcome. See CONTRIBUTING.md for the dev setup, project conventions, how to add an MCP tool, and the release process.
Quick version: fork → branch (feat/my-feature) → make changes (make sure npm run build and
npm test pass; run npm run docs:gen if you touched tools) → open a PR.
Maintainer
Built and maintained by @artokun, a regular contributor across the Comfy-Org ecosystem:
- Comfy-Org/ComfyUI_frontend. 10 merged PRs, mostly on the v2 graph renderer: subgraph rendering, promoted-widget plumbing, viewport persistence, with backports across
cloud/1.41,cloud/1.42,core/1.41, andcore/1.42. - Comfy-Org/ComfyUI (core). Crash fixes in the Python backend's video/audio save path (#12683, #12550).
If you're at Comfy-Org (or hiring around the ComfyUI ecosystem), I'd love to chat. Email me at [email protected].
License
MIT. See LICENSE for details.
Changelog
See CHANGELOG.md for the full, structured release history.
来源:README.md,提交 5bfe534
工具
0版本历史
6- v0.52.206最新Oct 14, 2026
- v0.52.206-beta.6Oct 14, 2026
- v0.52.206-beta.5Oct 14, 2026
- v0.52.205Oct 2, 2026
- v0.52.204Oct 1, 2026
- v0.52.203Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分