/ Directory / Playground / ComfyUI MCP Server
● Community joenorton 🔑 Needs your key

ComfyUI MCP Server

by joenorton · joenorton/comfyui-mcp-server

Local ComfyUI as an MCP tool — generate images, audio, and video, run workflows, and manage assets without opening the ComfyUI UI.

comfyui-mcp-server bridges a locally running ComfyUI (port 8188) to any MCP client. Agents can generate and regenerate images, submit custom workflows, poll and cancel jobs, view generated assets, switch models, and publish outputs — all via MCP tools. Useful for iterative creative work, batch generation, and programmatic pipeline runs where you don't want to drag nodes around manually.

Why use it

Key features

Live Demo

What it looks like in practice

comfyui-mcp-server.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "comfyui-mcp-server": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "_inferred": false,
      "env": {
        "COMFYUI_URL": "http://127.0.0.1:8188"
      }
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "comfyui-mcp-server": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "_inferred": false,
      "env": {
        "COMFYUI_URL": "http://127.0.0.1:8188"
      }
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "comfyui-mcp-server": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "_inferred": false,
      "env": {
        "COMFYUI_URL": "http://127.0.0.1:8188"
      }
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "comfyui-mcp-server": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "_inferred": false,
      "env": {
        "COMFYUI_URL": "http://127.0.0.1:8188"
      }
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "comfyui-mcp-server",
      "command": "python",
      "args": [
        "server.py"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "comfyui-mcp-server": {
      "command": {
        "path": "python",
        "args": [
          "server.py"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add comfyui-mcp-server -- python server.py

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use ComfyUI MCP Server

Iterate an image concept with text prompts

👤 Designers and artists using ComfyUI locally ⏱ ~20 min intermediate

When to use: You have ComfyUI set up but want to iterate via chat instead of node graphs.

Prerequisites
  • ComfyUI running on port 8188 — Follow ComfyUI install; ensure a checkpoint model is in models/checkpoints/
  • MCP server started — python server.py (listens at http://127.0.0.1:9000/mcp)
Flow
  1. Generate v1
    Generate an image: photoreal portrait, overcast light, 1024×1280.✓ Copied
    → Job submitted; id returned; image appears when done
  2. Regenerate with tweaks
    Regenerate from that seed — slightly warmer tones, keep composition.✓ Copied
    → Same composition, warmer colors
  3. View + publish
    View the latest image; publish it to the gallery as 'portrait-final.png'.✓ Copied
    → Asset metadata + publish URL

Outcome: Fast iteration without clicking nodes.

Pitfalls
  • Forgetting ComfyUI must be running before the MCP server starts — Start ComfyUI first, then the MCP server
Combine with: filesystem

Kick off a saved ComfyUI workflow from chat

👤 Teams with established ComfyUI workflows ⏱ ~15 min intermediate

When to use: You already built a workflow; now you want to run it programmatically.

Prerequisites
  • A workflow saved in ComfyUI — Save As → workflow JSON
Flow
  1. List workflows
    List my workflows.✓ Copied
    → Array with names/ids
  2. Run it
    Run 'product-shot-v3' with positive='ceramic mug on marble', negative='blurry'.✓ Copied
    → Job created; parameters echoed
  3. Wait + grab the result
    Tell me when it finishes and show the image.✓ Copied
    → Polls queue; returns asset when complete

Outcome: Workflow orchestration from chat — ideal for batch runs.

Pitfalls
  • Workflow references custom nodes not installed — Install the required custom nodes in ComfyUI before running
Combine with: comfy-pilot

Turn a short script into a video with a video workflow

👤 Content creators producing shorts ⏱ ~45 min advanced

When to use: You have a ComfyUI video workflow (e.g., AnimateDiff / Mochi) and want to feed prompts sequentially.

Flow
  1. Load the video workflow
    Run the 'shorts-v2' workflow with a scene list: [scene prompts].✓ Copied
    → Segments queued; progress per scene
  2. Stitch and publish
    Publish the final video.✓ Copied
    → Output path + publish metadata

Outcome: Short videos via local compute, no cloud fees per render.

Pitfalls
  • GPU memory exhaustion on longer clips — Reduce resolution or frames per segment; batch sequentially

Combinations

Pair with other MCPs for X10 leverage

comfyui-mcp-server + comfy-pilot

Pair this MCP with the Claude-Code-in-ComfyUI editor for full-pipeline authoring

Build the workflow via comfy-pilot, run it via this MCP server.✓ Copied
comfyui-mcp-server + filesystem

Organize generated assets under project folders

After each batch, move outputs into ./assets/<project>/ with dated filenames.✓ Copied
comfyui-mcp-server + mcp-image

Use mcp-image for one-off Gemini gens; ComfyUI for your local SD/FLUX pipelines

Draft hero via mcp-image; deliver brand set via the ComfyUI workflow.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
generate_image prompt, settings Standard text-to-image local compute only
generate_song / generate_video prompt, workflow Audio/video generation via dedicated workflows local compute
regenerate reference job_id, tweaks Iterate off a prior result local compute
view_image asset_id Show an asset inline 0
get_queue_status / get_job / cancel_job job_id Lifecycle management 0
list_assets / get_asset_metadata filter Browse generated outputs 0
list_models / get_defaults / set_defaults optional model name Switch checkpoints or adjust defaults 0
list_workflows / run_workflow name + inputs Run saved workflows 0 to start
publish_asset / get_publish_info asset_id Mark a final asset 0

Cost & Limits

What this costs to run

API quota
Local only — bound by your GPU
Tokens per call
Prompt text small; asset bytes large
Monetary
Free — your electricity and hardware
Tip
Use lower steps / smaller resolution for iteration; reserve full settings for the keeper.

Security

Permissions, secrets, blast radius

Credential storage: No credentials for local ComfyUI. If you proxy it to cloud, add auth at the proxy.
Data egress: ComfyUI runs locally; server traffic is 127.0.0.1 by default. Model downloads pull from HuggingFace / CivitAI depending on your workflow.

Troubleshooting

Common errors and fixes

Connection refused 127.0.0.1:8188

Start ComfyUI first; confirm the UI loads in a browser.

Verify: curl localhost:8188/system_stats
Workflow fails with missing custom node

Open ComfyUI Manager and install the required custom nodes, then retry.

Verify: Manager → Install Missing Custom Nodes
Jobs queue but never complete

Check ComfyUI's own console for a CUDA OOM or model loading error.

Verify: Inspect the ComfyUI terminal output

Alternatives

ComfyUI MCP Server vs others

AlternativeWhen to use it insteadTradeoff
comfy-pilotYou want an editor that lets Claude draft workflows inside ComfyUI itselfNot a pure MCP server; requires ComfyUI node install
mcp-imageYou want zero-setup cloud generation via GeminiPay per image; less workflow flexibility
everartYou want style-trained cloud modelsDifferent provider

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills