Skip to main content
Glama

ComfyUI MCP Server

A Model Context Protocol (MCP) server that enables Claude Desktop to interact with your local ComfyUI installation for AI-powered image generation.

Features

  • 15 MCP Tools for complete ComfyUI control

  • Template-based generation (Flux, SD1.5, SDXL, img2img)

  • Custom workflow execution with smart parameter overrides

  • Real-time progress monitoring via WebSocket

  • Model management (list checkpoints, LoRAs, VAEs, etc.)

  • Workflow library for saving and reusing workflows

  • Queue management (status, cancel, clear)

  • Image upload/retrieval with full Windows path support

Related MCP server: ComfyUI MCP Server

Prerequisites

  • Node.js v20 or higher

  • ComfyUI installed and running at http://127.0.0.1:8188

  • Claude Desktop (for MCP integration)

  • Windows 11 (as per specification)

Installation

1. Install Dependencies

NOTE

The file paths in the examples below must be replaced with the correct paths for your system.

cd [Path to your ComfyUI MCP Server]
npm install

2. Configure Paths

Edit config.json to match your ComfyUI installation:

{
  "comfyui": {
    "installation_path": "[Path to your ComfyUI portable installation]"
  }
}

3. Build the Server

npm run build

4. Configure Claude Desktop

Edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "comfyui": {
      "command": "node",
      "args": [
        "[Path to your ComfyUI MCP Server]\\dist\\index.js"
      ],
      "env": {
        "COMFYUI_CONFIG": "[Path to your ComfyUI MCP Server]\\config.json"
      }
    }
  }
}

5. Restart Claude Desktop

The ComfyUI tools will now be available in Claude Desktop.

Available Tools

Generation

  • comfy_submit_workflow - Submit custom workflow JSON with overrides

  • comfy_generate_simple - Quick generation using templates

Status & Monitoring

  • comfy_get_status - Check generation status and outputs

  • comfy_wait_for_completion - Wait for generation to complete

Model Management

  • comfy_list_models - List available models, LoRAs, VAEs

Workflow Library

  • comfy_save_workflow - Save workflow to library

  • comfy_load_workflow - Load saved workflow

  • comfy_list_workflows - List all saved workflows

  • comfy_delete_workflow - Delete workflow from library

Queue Management

  • comfy_get_queue - Get current queue status

  • comfy_cancel_generation - Cancel generation

  • comfy_clear_queue - Clear pending queue items

Utilities

  • comfy_upload_image - Upload image to ComfyUI input folder

  • comfy_get_output_images - List recent output images

Usage Examples

Simple Text-to-Image Generation

Ask Claude:

Generate an image of a sunset over mountains using Flux

Claude will use comfy_generate_simple with the flux_txt2img template.

Custom Workflow Execution

Use my chrono_edit workflow to animate this product image

Claude will:

  1. Load your workflow with comfy_load_workflow

  2. Upload the image with comfy_upload_image

  3. Submit with comfy_submit_workflow and parameter overrides

Check Available Models

What Flux models do I have available?

Claude will use comfy_list_models with filter="flux".

Configuration

Template Defaults

Edit config.json to customize template defaults:

{
  "templates": {
    "flux_txt2img": {
      "default_model": "flux_dev.safetensors",
      "default_steps": 20,
      "default_cfg": 3.5
    }
  }
}

Workflow Library Path

Workflows are saved to:

[Path to your ComfyUI portable installation]\ComfyUI\user\default\workflows\mcp_library

Troubleshooting

"Cannot connect to ComfyUI"

  • Ensure ComfyUI is running: run_nvidia_gpu.bat

  • Check ComfyUI is accessible at http://127.0.0.1:8188

  • Verify port 8188 is not blocked by firewall

"Model not found"

  • Run comfy_list_models to see available models

  • Check model file exists in the correct folder

  • Verify model name spelling matches exactly

"Workflow validation failed"

  • Test workflow in ComfyUI UI first

  • Check all node connections are valid

  • Ensure all required models are available

Permission Errors

  • Check folder permissions on ComfyUI directories

  • Run Claude Desktop as administrator if needed

  • Verify paths in config.json are accessible

Development

Build in Watch Mode

npm run dev

Clean Build

npm run clean
npm run build

Architecture

Claude Desktop (stdio) → MCP Server → ComfyUI API (HTTP/WebSocket)
                              ↓
                         File System
                         - Models
                         - Input/Output
                         - Workflow Library

The MCP server runs as a separate Node.js process and communicates with ComfyUI via its HTTP API and WebSocket connections. It does not modify any ComfyUI files.

License

MIT

Support

For issues and questions, refer to the specification document or ComfyUI API documentation.

Available Tools

14 tools
comfy_cancel_generationB

Cancel a specific generation or interrupt the currently executing generation. Can optionally remove from queue.

Inputs: prompt_id, delete_from_queue.

comfy_clear_queueA

Clear all pending items from the queue (does not affect currently running generation). Requires confirmation.

Inputs: confirm.

comfy_delete_workflowA

Delete a saved workflow from the MCP library. Requires confirmation for safety.

Inputs: name (required), confirm.

comfy_generate_simpleC

Quick image generation using pre-configured workflow templates (flux_txt2img, sd15_txt2img, sdxl_txt2img, basic_img2img). Ideal for common use cases without managing workflow JSON.

Inputs: prompt (required), template (required), negative_prompt, model, +10 more.

comfy_get_output_imagesA

List recent output images from ComfyUI's output folder. Returns full Windows paths that Claude Desktop can read.

Inputs: limit, sort, filter.

comfy_get_queueA

Get detailed information about the current generation queue, including running and pending items.

Inputs: no named parameters.

comfy_get_statusA

Get the current status and progress of a specific generation or the overall queue. Returns queue position, progress, and output paths when available.

Inputs: prompt_id, include_outputs.

comfy_list_modelsB

List available models, checkpoints, LoRAs, VAEs, and other resources in the ComfyUI models directory. Supports filtering by type and name.

Inputs: type, filter, include_size.

comfy_list_workflowsA

List all saved workflows in the MCP library. Supports filtering by name, description, or tags.

Inputs: filter, tags.

comfy_load_workflowB

Load a saved workflow from the MCP library by name. Returns the workflow JSON and metadata.

Inputs: name (required).

comfy_save_workflowC

Save a workflow JSON to the MCP library for later reuse. Includes metadata like description and tags for organization.

Inputs: name (required), workflow (required), description, tags, +1 more.

comfy_submit_workflowB

Submit a complete workflow JSON to ComfyUI for execution. Supports parameter overrides for dynamic modifications without editing the workflow structure.

Inputs: workflow (required), overrides, client_id.

comfy_upload_imageC

Upload an image to ComfyUI's input folder for use in workflows. Supports custom filenames and overwrite control.

Inputs: image_path (required), filename, overwrite.

comfy_wait_for_completionA

Block until a generation completes or fails. Returns final outputs with image paths. Useful for synchronous workflows.

Inputs: prompt_id (required), timeout, poll_interval.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no ambiguity. For example, comfy_generate_simple is for quick image generation, comfy_submit_workflow handles complete workflow execution, and comfy_get_status monitors progress, all targeting different aspects of the ComfyUI workflow lifecycle. The descriptions clearly differentiate between queue management, workflow management, generation, and output handling.

    Naming Consistency5/5

    All tools follow a consistent comfy_verb_noun pattern with snake_case throughout. The naming convention is predictable and readable, such as comfy_list_workflows, comfy_save_workflow, and comfy_cancel_generation. This uniformity helps agents easily identify and select the appropriate tools.

    Tool Count5/5

    With 14 tools, the count is well-scoped for managing ComfyUI workflows, covering generation, queue management, workflow storage, and output retrieval. Each tool earns its place by addressing specific needs in the image generation pipeline, from submission to completion, without being excessive or insufficient.

    Completeness5/5

    The tool surface provides complete coverage for the ComfyUI domain, including CRUD operations for workflows (list, load, save, delete), generation lifecycle (submit, cancel, wait, status), queue management (get, clear), and output handling (get images, upload image). There are no obvious gaps, enabling agents to handle end-to-end workflows seamlessly.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers