Skip to main content
Glama
Comfy Pilot - OpenCode Edition

Comfy Pilot - OpenCode Edition

by jaijia

Comfy Pilot - OpenCode Edition

MCP server that lets OpenCode (or any MCP-compatible AI coding tool) directly control ComfyUI for AI image generation.

Forked from ConstantineB6/comfy-pilot and adapted for OpenCode compatibility.

What this does

Instead of manually clicking nodes in ComfyUI, you just tell your AI agent:

  • "Generate a 1920x1080 background of a dystopian room"

  • "Create a character sprite with 3 expression variants"

  • "Download this model and set up a workflow for it"

The agent uses MCP tools to manipulate your ComfyUI workflow, set prompts, and run generations — all programmatically.

Related MCP server: ComfyUI MCP

Features

Tool

Description

get_workflow

Get the full current workflow

summarize_workflow

Human-readable workflow summary

get_node_types

Search available node types

get_node_info

Get detailed info about a node

get_status

Queue status and system info

run

Run the workflow / interrupt

edit_graph

Batch create, delete, move, connect nodes

view_image

View outputs from image nodes

search_custom_nodes

Search ComfyUI Manager registry

install_custom_node

Install a custom node

uninstall_custom_node

Uninstall a custom node

update_custom_node

Update a custom node

download_model

Download models from HF/CivitAI/URLs

Quick Start

1. Install dependencies

pip install mcp httpx

2. Start ComfyUI

Make sure ComfyUI is running on http://localhost:8188.

3. Configure OpenCode

Add to ~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "comfyui": {
      "type": "local",
      "command": ["python", "C:\\path\\to\\mcp_server.py"],
      "enabled": true
    }
  }
}

Or for Claude Code (~/.claude/settings.json):

{
  "mcpServers": {
    "comfyui": {
      "command": "python",
      "args": ["/path/to/mcp_server.py"]
    }
  }
}

4. Restart your AI tool

Restart OpenCode or Claude Code to pick up the new MCP server.

5. Start generating

Once connected, you can just talk naturally:

"Load the Counterfeit model, set prompt to a dark sci-fi room, 1920x1080, and run it."

Requirements

  • Python 3.8+

  • ComfyUI (running on localhost:8188)

  • An MCP-compatible client (OpenCode, Claude Code, etc.)

How it works

┌──────────────┐       stdio/MCP        ┌──────────────┐       HTTP REST       ┌──────────┐
│  OpenCode    │ ◄──────────────────────►│  MCP Server  │ ◄────────────────────►│ ComfyUI  │
│  (AI Agent)  │    command/prompt       │  (Python)    │   localhost:8188      │ (Server) │
└──────────────┘                         └──────────────┘                       └──────────┘

The MCP server translates natural language commands from the AI agent into ComfyUI API calls, then streams results back.

License

MIT — see LICENSE

Credits

Original project: ConstantineB6/comfy-pilot

Available Tools

14 tools
center_on_nodeA

Center the user's viewport on a specific node. Useful after creating nodes to show the user where they were placed.

Inputs: node_id (required).

download_modelA

Download a model to the ComfyUI models folder. Supports Hugging Face, CivitAI, and direct URLs. For gated HF models, will return instructions to provide a token.

Inputs: url (required), model_type (required), filename, hf_token, +1 more.

edit_graphA

Edit workflow graph with batched operations. Actions: create, delete, move, resize, set, connect, disconnect. Operations execute in order; 'create' returns node_id for chaining.

Inputs: operations (required).

get_node_infoB

Get detailed info about a specific node in the workflow: type, properties, inputs, outputs, widget values.

Inputs: node_id (required).

get_node_typesA

Search available node types. Returns minimal info by default. Use 'fields' for more details.

Inputs: fields, search, category.

get_statusA

Get ComfyUI status: queue, system stats, and/or history. Returns lightweight summaries by default (counts, IDs). Use detail='full' for more info. History is always paginated.

Inputs: detail, include, history_limit, history_offset.

get_workflowA

Get the current workflow from ComfyUI. Returns full node graph with all nodes, connections, and widget values. Use summarize_workflow for a lighter overview.

Inputs: no named parameters.

install_custom_nodeA

Install a custom node via ComfyUI Manager. Requires restart to complete.

Inputs: node_id (required).

runC

Run workflow or interrupt current generation.

Inputs: action, node_ids.

search_custom_nodesA

Search for custom nodes in the ComfyUI Manager registry. Returns name, author, description, install status, and star count.

Inputs: limit, query, status, category.

summarize_workflowA

Get a concise summary of the current workflow: node IDs, types, titles, positions, and connections. Lighter than get_workflow.

Inputs: no named parameters.

uninstall_custom_nodeA

Uninstall a custom node via ComfyUI Manager. Requires restart to complete.

Inputs: node_id (required).

update_custom_nodeB

Update a custom node to the latest version via ComfyUI Manager. Requires restart to complete.

Inputs: node_id (required).

view_imageA

View an image from a Preview Image or Save Image node. Returns the image as base64 so you can see it. Run the workflow first to generate images.

Inputs: node_id, image_index.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool serves a distinct purpose: workflow editing, node inspection, custom node management, model downloading, execution, and image viewing. There is no overlap or ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent lowercase verb_noun pattern (e.g., download_model, get_workflow, search_custom_nodes), with clear verbs indicating the action.

    Tool Count5/5

    14 tools is well-scoped for a ComfyUI interface, covering essential operations like editing, custom node management, model downloading, and execution without being excessive.

    Completeness4/5

    The tool set covers core workflows (edit, run, view) and custom node lifecycle, but lacks explicit workflow save/load and queue management, which are minor gaps.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server exposing a local (or LAN) ComfyUI instance's HTTP API as tools, so an LLM client can queue generations, inspect the queue/history, upload reference images, browse installed models/nodes, and pull back generated images.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that enables AI agents to control a local ComfyUI instance for image generation, allowing workflow understanding, parameter modification, execution, and model discovery.
      16 npm
      3
      Apache 2.0