MCP.so
Sign In

ComfyUI MCP Server

@joenorton

About ComfyUI MCP Server

lightweight Python-based MCP (Model Context Protocol) server for local ComfyUI

Basic information

Category

Other

License

Apache-2.0

Runtime

python

Transports

stdio

Publisher

joenorton

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "comfyui-mcp-server": {
      "command": "python",
      "args": [
        "main.py",
        "--port",
        "8188"
      ]
    }
  }
}

Tools

No tools detected

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is ComfyUI MCP Server?

A lightweight MCP (Model Context Protocol) server that lets AI agents generate and iteratively refine images, audio, and video using a local ComfyUI instance. It exposes tools such as generate_image, generate_song, regenerate, view_image, job management, and publishing via natural conversation.

How to use ComfyUI MCP Server?

Clone the repository, install dependencies with pip install -r requirements.txt, ensure ComfyUI is running locally (default port 8188), then start the server with python server.py. Connect an AI client (e.g., Cursor, Claude, n8n) by adding a .mcp.json file with the server URL http://127.0.0.1:9000/mcp and using either "type": "streamable-http" or "type": "http". The included test_client.py can verify the setup without an AI client.

Key features of ComfyUI MCP Server

  • Generate images, audio, and video via natural language
  • Iterative refinement with regenerate (no re-prompting needed)
  • Job management: polling, cancellation, queue status
  • Asset identity via (filename, subfolder, type) for reliable follow-ups
  • Optional visual feedback for agents with view_image
  • Configurable defaults and custom workflow support
  • Publishing assets to web projects with deterministic compression

Use cases of ComfyUI MCP Server

  • AI agents generating and refining images through iterative conversation
  • Automated asset creation for web projects with publishing to a project directory
  • Multi-modal generation (images, audio, video) from a single local instance
  • Controlled generation with explicit job management for long-running tasks
  • Integration with AI assistants to produce publishable media assets

FAQ from ComfyUI MCP Server

What dependencies are required?

ComfyUI must be installed and running locally on port 8188. Python 3.8+ and the packages in requirements.txt are needed. Models must be placed in <ComfyUI_dir>/models/checkpoints/.

How does the transport work?

The server uses Streamable HTTP transport (HTTP‑based, not WebSocket). It binds to http://127.0.0.1:9000/mcp by default. Clients can connect using "type": "streamable-http" or "type": "http".

Where are generated assets stored?

Assets are stored locally on the machine running ComfyUI. They are ephemeral: asset_id references are valid only while the MCP server runs and until the 24‑hour TTL (configurable). Assets are lost on server restart.

Is authentication supported?

No authentication is built in. The server binds to localhost only and should not be exposed publicly without a reverse proxy or authentication layer.

What are the known limitations?

The asset registry is ephemeral (lost on server restart), assets expire after 24 hours (configurable via COMFY_MCP_ASSET_TTL_HOURS), and view_image only supports image formats (PNG, JPEG, WebP, GIF). Workflows must contain PARAM_* placeholders to be auto‑exposed as tools.

Comments

More Other MCP servers