Skip to main content
Glama
README.md
# ComfyUI MCP

Minimal MCP server that wraps ComfyUI HTTP routes so an LLM client can:

- inspect server status, models, features, node metadata
- submit workflows via `/prompt`
- inspect or manage queue/history
- interrupt runs
- upload input images

Python requirement: `3.10+` (the official `mcp` SDK requires it).

This server targets ComfyUI local server routes documented in:

- https://docs.comfy.org/development/comfyui-server/comms_routes
- https://docs.comfy.org/development/comfyui-server/api-key-integration

## 1) Install

```bash
cd /Users/apple/projects/comfyui-mcp
python3.10 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .
```

## 2) Configure

```bash
export COMFYUI_BASE_URL="http://127.0.0.1:8188"
export COMFYUI_ROUTE_PREFIX=""
export COMFYUI_TIMEOUT_SECONDS="60"
# optional: for reverse proxies or cloud-style gateways
export COMFYUI_BEARER_TOKEN=""
```

Notes:

- `COMFYUI_ROUTE_PREFIX` can be set to `/api` if your endpoint is exposed only under `/api/*`.
- ComfyUI native server supports both prefixed and non-prefixed routes.
- For paid API nodes in workflow payloads, pass `api_key_comfy_org` in `comfyui_submit_prompt`.

## 3) Run (stdio transport)

```bash
cd /Users/apple/projects/comfyui-mcp
source .venv/bin/activate
comfyui-mcp
```

## 4) Example MCP client config

```json
{
  "mcpServers": {
    "comfyui": {
      "command": "/Users/apple/projects/comfyui-mcp/.venv/bin/comfyui-mcp",
      "env": {
        "COMFYUI_BASE_URL": "http://127.0.0.1:8188",
        "COMFYUI_ROUTE_PREFIX": ""
      }
    }
  }
}
```

## Exposed tools

- `comfyui_get_system_stats`
- `comfyui_get_features`
- `comfyui_list_models`
- `comfyui_get_object_info`
- `comfyui_get_queue`
- `comfyui_manage_queue`
- `comfyui_get_history`
- `comfyui_manage_history`
- `comfyui_submit_prompt`
- `comfyui_interrupt`
- `comfyui_upload_image`

TDQS

A3.7/5.0

Scored across 11 tools

Disambiguation5/5

Each tool targets a distinct ComfyUI API endpoint or action, with clear descriptions preventing any confusion. No overlapping purposes exist.

Naming Consistency5/5

All tools follow a consistent 'comfyui_verb_noun' pattern (e.g., comfyui_get_history, comfyui_submit_prompt), making naming predictable and easy to navigate.

Tool Count5/5

With 11 tools, the set covers the essential operations for interacting with ComfyUI without being excessive or sparse. Each tool serves a clear purpose.

Completeness4/5

The tool set covers core CRUD and lifecycle operations (get, manage, submit, upload, interrupt). Minor omissions like image viewing or memory management exist, but the main workflows are complete.

Maintenance

ActivityInactive
ResponsivenessNo issues