Comfy

Provides automated control and image generation for ComfyUI through MCP clients using API-format workflows.
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "io-ateliertech-comfyui-mcp": {
      "command": "uvx",
      "args": [
        "comfyui-easy-mcp"
      ],
      "env": {
        "COMFY_URL": "http://localhost:8188",
        "OUTPUT_NODE_ID": "9",
        "PROMPT_NODE_ID": "6",
        "COMFY_WORKFLOWS_DIR": "/path/to/workflows-api",
        "COMFY_WORKFLOWS_UI_DIR": "/path/to/workflows-ui",
        "COMFY_WORKFLOW_JSON_FILE": "/path/to/workflows-api/default.json"
      }
    }
  }
}

You run an MCP server that exposes ComfyUI control and image generation capabilities to MCP clients. It lets you monitor the system, run workflows, manage and validate workflows, discover nodes and models, and generate images either through a simple prompt or full workflow control. This guide shows how to install, configure, and use the server in practical steps so you can automate and streamline your ComfyUI workflows.

How to use

You connect to the server from an MCP client by configuring a server entry that uses the standard MCP protocol. Once connected, you can check server health, view and manage the workflow queue, run saved workflows, load or create new workflows, discover available nodes and models, and generate images. Use the dedicated tools to list nodes, load or save workflows, validate structures, and execute arbitrary workflow dicts or named workflows. When you generate an image, you can either rely on a simple prompt-based flow or take full control of a complex workflow to orchestrate specific nodes and connections.

Key practical patterns you will use: - Inspect system stats to ensure the server and hardware are healthy. - List and inspect nodes to understand inputs and parameters before building a workflow. - Build or modify workflows and validate them before execution. - Execute a saved workflow or submit a custom workflow and monitor the status. - Generate images through a simple prompt or a fully defined workflow and retrieve the result.

How to install

Prerequisites: - Python is installed and accessible as your system Python. - You have a ComfyUI server running locally or remotely. - Workflow files are exported from ComfyUI in API format for MCP execution.

Option 1: Install via MCP tooling (recommended for quick setup)

uvx comfyui-easy-mcp
# Or install globally using pip within your environment
uv pip install comfyui-easy-mcp

Additional setup you may need

If you prefer configuring a local, self-contained MCP server, you can run the MCP client tooling with a pre-configured setup that points to your ComfyUI instance, including where to find workflows and how to output results. The following example shows a typical local runtime configuration to connect to a local ComfyUI server at http://localhost:8188 and to use local workflow directories.

Example local initialization and environment variables (set these in your shell before starting the MCP client):

export COMFY_URL=http://localhost:8188
export COMFY_WORKFLOWS_DIR=/path/to/workflows-api
export COMFY_WORKFLOWS_UI_DIR=/path/to/workflows-ui
export COMFY_WORKFLOW_JSON_FILE=/path/to/workflows-api/default.json
export PROMPT_NODE_ID=6
export OUTPUT_NODE_ID=9
export OUTPUT_MODE=file

Configuration and environment

The MCP setup relies on a few environment variables to tell the server where to find ComfyUI, which workflows to use, and how to output results. Use these variables in your shell or in your deployment environment so the MCP client can locate the ComfyUI instance, load workflows, and generate images.

Troubleshooting and notes

If you encounter validation errors when creating or running a workflow, ensure you are using API-format workflows for MCP execution. UI-format workflows are for editing in the ComfyUI editor and will be rejected by the MCP execution path. Check that node names, inputs, and connections are valid for the selected API format. If the queue is stuck or you see persistent errors, verify that the ComfyUI server is reachable at the URL you configured and that the required workflow files exist at the specified paths.

Security and maintenance

Keep your ComfyUI server URL and any API keys or tokens used by cloud connectors secure. Regularly update the MCP server package to benefit from bug fixes and compatibility improvements with ComfyUI releases. If you operate in a shared environment, consider isolating the MCP server in a container or dedicated virtual environment and restrict access to trusted clients.

Examples and tips

Tip: start with a simple workflow that loads an image, applies a basic transform, and saves the result. Validate the workflow before executing it, then run the workflow and inspect the output at the designated node. As you gain confidence, expand the workflow by adding more nodes or by branching logic to handle different inputs.

Notes on architecture and components

The MCP server provides system tools for monitoring, discovery, workflow management, and execution. It interfaces with ComfyUI through a defined API format for automation and scripting, while UI-format workflows remain for editor use. The server includes a compatibility layer to accommodate different ComfyUI versions and a layout engine to position programmatically generated workflows clearly.

Environment example for a ready-to-run client

# Example MCP server connection (stdio, local runtime)
"mcpServers": {
  "ComfyUI": {
    "type": "stdio",
    "name": "comfyui",
    "command": "uvx",
    "args": ["comfyui-easy-mcp"],
    "env": {
      "COMFY_URL": "http://localhost:8188",
      "COMFY_WORKFLOWS_DIR": "/path/to/workflows-api",
      "COMFY_WORKFLOWS_UI_DIR": "/path/to/workflows-ui",
      "COMFY_WORKFLOW_JSON_FILE": "/path/to/workflows-api/default.json",
      "PROMPT_NODE_ID": "6",
      "OUTPUT_NODE_ID": "9"
    }
  }
}

Available tools

get_system_stats

Get ComfyUI server health: version, memory, device info

get_queue_status

Get current queue: running and pending jobs

get_history

Get recent generation history (limit 1-100)

cancel_current

Interrupt current generation

clear_queue

Clear the queue or delete specific items

list_nodes

List available ComfyUI nodes (optional filter)

get_node_info

Get detailed node info: inputs, outputs, parameters

search_nodes

Search nodes by name, type, or category

list_models

List models in a folder

list_model_folders

List available model folder types

list_embeddings

List available embeddings

list_extensions

List loaded extensions (custom node packs)

refresh_nodes

Refresh cached node list from ComfyUI

list_workflows

List available workflow files

load_workflow

Load a workflow from file

save_workflow

Save workflow (format: api or ui)

create_workflow

Create an empty workflow structure

add_node

Add a node to a workflow

remove_node

Remove a node from a workflow

update_node_input

Update a node's input

validate_workflow

Validate workflow structure and node types

convert_workflow_to_ui

Convert API format to UI/Litegraph format

list_templates

List available workflow templates

get_workflow_template

Get a pre-built workflow template

generate_image

Generate image using default workflow (simple interface)

run_workflow

Execute a saved workflow file

execute_workflow

Execute an arbitrary workflow dict

submit_workflow

Submit workflow without waiting (returns prompt_id)

get_prompt_status

Get status of a submitted prompt

get_result_image

Get result image from completed prompt

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational