Comfy Agent — Self-Upgrading ComfyUI MCP
Comfy Agent — Self-Upgrading ComfyUI MCP is a free agent skill maintained by Scopeful. It teaches an AI coding agent such as Claude Code, Cursor, Windsurf or Codex how to drive this tool correctly, so you do not have to re-explain it every session. Every published Scopeful skill is free and the install command is public, with no sign-in required. Install it with curl -H "Authorization: Bearer YOUR_API_KEY" -OJ https://scopeful.org/api/download?package=comfyui-mcp. Scopeful also tracks hand-verified USD pricing for 39 AI creative tools at https://www.scopeful.org/tools.
ComfyUI MCP with self-upgrading skill and shared memory. Your AI agent builds graphs, runs generations, and learns from every session across all agents.
Install
curl -H "Authorization: Bearer YOUR_API_KEY" -OJ https://scopeful.org/api/download?package=comfyui-mcpReference
name: comfyui-mcp description: Python toolkit that lets AI agents install, launch, and run ComfyUI workflows. Hardware detection, dependency management, parameter injection, batch runs, and live WebSocket progress.
What it does
A headless Python toolkit for AI agents that need to generate images, video, or audio through ComfyUI. The agent handles everything from hardware detection and installation to workflow execution and output retrieval, without a browser window or manual node wiring.
Two layers work together: the official comfy-cli manages server lifecycle (install, launch, stop, model downloads, custom node installs), and a set of Python scripts handle workflow execution through ComfyUI's REST and WebSocket APIs (parameter injection, batch runs with seed sweeps, live progress monitoring, output download).
What's in it
Scripts:
hardware_check.py-- probe GPU, VRAM, and disk to decide local vs Comfy Cloudcomfyui_setup.sh-- full automated install (hardware check, comfy-cli, ComfyUI, launch, verify)extract_schema.py-- read a workflow JSON, list every controllable parameter and model dependencycheck_deps.py/auto_fix_deps.py-- check a workflow against the running server, then auto-install missing nodes and modelsrun_workflow.py-- inject parameters, submit, monitor, download outputs (HTTP or WebSocket)run_batch.py-- submit a workflow N times with seed sweeps, parallel up to your tier limitws_monitor.py-- real-time WebSocket viewer for running jobshealth_check.py-- end-to-end verification (comfy-cli on PATH, server reachable, checkpoint present, smoke test)fetch_logs.py-- pull traceback or status messages for a given prompt_id
Reference docs covering every comfy CLI command, the REST/WebSocket API endpoints, workflow JSON format, and template conversion gotchas.
Example workflows for SD 1.5, SDXL, Flux Dev, SDXL img2img, SDXL inpaint, ESRGAN upscale, AnimateDiff video, and Wan T2V.
Setup: local or Comfy Cloud
Run python3 scripts/hardware_check.py first. It reports one of three verdicts:
- ok -- 8+ GB VRAM (discrete GPU) or 32+ GB unified memory (Apple Silicon). Install locally.
- marginal -- SD 1.5 works, SDXL is tight, Flux and video unlikely. Local for light work, Cloud for the rest.
- cloud -- no usable GPU. Use Comfy Cloud instead.
For local: bash scripts/comfyui_setup.sh runs the hardware check, installs comfy-cli via pipx, installs ComfyUI, launches the server, and verifies everything works.
For Cloud: export your API key (COMFY_CLOUD_API_KEY) and point scripts at --host https://cloud.comfy.org. No local install needed.
Run a workflow
# Extract controllable parameters
python3 scripts/extract_schema.py workflow_api.json
# Check dependencies against the running server
python3 scripts/check_deps.py workflow_api.json
# Run with parameter injection
python3 scripts/run_workflow.py \
--workflow workflow_api.json \
--args '{"prompt": "a red fox in snow", "seed": -1, "steps": 25}' \
--output-dir ./outputs
# Batch: 8 variations with random seeds
python3 scripts/run_batch.py \
--workflow workflow_api.json \
--args '{"prompt": "abstract shapes"}' \
--count 8 --randomize-seed --parallel 3 \
--output-dir ./outputs/batch
Works with SDXL, Flux (Dev/Schnell/Kontext), SD3, AnimateDiff, Wan T2V, Hunyuan Video, and any ComfyUI-compatible model.