AgentStack
MCP verified MIT Self-run

Comfyui Mcp

mcp-shawnrushefsky-comfyui-mcp · by shawnrushefsky

MCP server for ComfyUI - Enables AI assistants to generate images, video, audio, and 3D

No reviews yet
0 installs
17 views
0.0% view→install

Install

$ agentstack add mcp-shawnrushefsky-comfyui-mcp

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Comfyui Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

ComfyUI MCP Server

  • [ComfyUI MCP Server](#comfyui-mcp-server)
  • [Let Your AI Install This For You](#let-your-ai-install-this-for-you)
  • [What is This?](#what-is-this)
  • [Key Features](#key-features)
  • [Self-Configuring](#self-configuring)
  • [Works Without ComfyUI Running](#works-without-comfyui-running)
  • [Workflow-First Architecture](#workflow-first-architecture)
  • [70+ Example Workflows](#70-example-workflows)
  • [Template System](#template-system)
  • [Workflow Composition Tools](#workflow-composition-tools)
  • [Quick Start Guide](#quick-start-guide)
  • [Step 1: Install ComfyUI](#step-1-install-comfyui)
  • [Step 2: Download a Model](#step-2-download-a-model)
  • [Step 3: Configure Your AI Assistant](#step-3-configure-your-ai-assistant)
  • [Step 4: Start Generating!](#step-4-start-generating)
  • [Installation](#installation)
  • [Prerequisites](#prerequisites)
  • [Option 1: Docker (Recommended)](#option-1-docker-recommended)
  • [Claude Desktop](#claude-desktop)
  • [Claude Code (CLI)](#claude-code-cli)
  • [Cursor](#cursor)
  • [Windsurf](#windsurf)
  • [Cline (VS Code Extension)](#cline-vs-code-extension)
  • [Linux (Any Client)](#linux-any-client)
  • [Port Configuration](#port-configuration)
  • [Option 2: From Source](#option-2-from-source)
  • [Tools Reference](#tools-reference)
  • [Setup \& Status Tools](#setup--status-tools)
  • [get_status](#get_status)
  • [get_install_guide](#getinstallguide)
  • [get_model_guide](#getmodelguide)
  • [Template \& Workflow Tools](#template--workflow-tools)
  • [search_templates](#search_templates)
  • [get_template](#get_template)
  • [save_template](#save_template)
  • [delete_template](#delete_template)
  • [list_examples](#list_examples)
  • [get_example_workflow](#getexampleworkflow)
  • [extract_workflow](#extract_workflow)
  • [recommend_workflow](#recommend_workflow)
  • [get_download_url](#getdownloadurl)
  • [Prompting Guide Tools](#prompting-guide-tools)
  • [get_prompting_guide](#getpromptingguide)
  • [Generation Tools](#generation-tools)
  • [run_workflow](#run_workflow)
  • [validate_workflow](#validate_workflow)
  • [get_image](#get_image)
  • [Workflow Composition Tools](#workflow-composition-tools-1)
  • [build_node](#build_node)
  • [get_node_info](#getnodeinfo)
  • [find_nodes_by_type](#findnodesby_type)
  • [list_nodes](#list_nodes)
  • [Discovery Tools](#discovery-tools)
  • [get_capabilities](#get_capabilities)
  • [list_models](#list_models)
  • [Task \& Queue Management](#task--queue-management)
  • [get_task](#get_task)
  • [get_task_result](#gettaskresult)
  • [list_tasks](#list_tasks)
  • [cancel_task](#cancel_task)
  • [name_generation](#name_generation)
  • [get_generation_by_name](#getgenerationby_name)
  • [get_queue](#get_queue)
  • [cancel_job](#cancel_job)
  • [interrupt](#interrupt)
  • [get_history](#get_history)
  • [Agent Memory Tools](#agent-memory-tools)
  • [save_note](#save_note)
  • [get_notes](#get_notes)
  • [search_notes](#search_notes)
  • [delete_note](#delete_note)
  • [list_topics](#list_topics)
  • [User Preferences Tools](#user-preferences-tools)
  • [get_user_preferences](#getuserpreferences)
  • [SVG & Font Tools](#svg--font-tools)
  • [render_svg](#render_svg)
  • [download_font](#download_font)
  • [list_fonts](#list_fonts)
  • [Configuration](#configuration)
  • [Environment Variables](#environment-variables)
  • [Config File](#config-file)
  • [How It Works](#how-it-works)
  • [Auto-Discovery](#auto-discovery)
  • [Capability Detection](#capability-detection)
  • [Workflow Execution](#workflow-execution)
  • [Example Conversations](#example-conversations)
  • [First-Time Setup](#first-time-setup)
  • [Generate Images with Templates](#generate-images-with-templates)
  • [Custom Workflow Composition](#custom-workflow-composition)
  • [Development](#development)
  • [Building](#building)
  • [Running Locally](#running-locally)
  • [Docker Build](#docker-build)
  • [Testing with MCP Inspector](#testing-with-mcp-inspector)
  • [Troubleshooting](#troubleshooting)
  • [ComfyUI not detected](#comfyui-not-detected)
  • [Models not found](#models-not-found)
  • [Generation fails](#generation-fails)
  • [Contributing](#contributing)
  • [License](#license)
  • [Acknowledgments](#acknowledgments)

[](https://github.com/shawnrushefsky/comfyui-mcp/actions/workflows/publish.yml)

An MCP (Model Context Protocol) server that enables AI assistants like Claude to interact with ComfyUI for generating images, audio, video, and more.


Let Your AI Install This For You

Copy and paste this prompt to your AI assistant (Claude, Cursor, etc.) to have it set everything up:

I want to generate images using ComfyUI. Please help me set up the ComfyUI MCP server.

1. First, add the ComfyUI MCP server to my configuration. The Docker config is:
   - Command: docker
   - Args: run -i --rm --pull always -e COMFYUI_URL=http://host.docker.internal:8000 ghcr.io/shawnrushefsky/comfyui-mcp:latest

2. Once configured, use get_status to check if ComfyUI is running and connected.

3. If ComfyUI isn't installed, use get_install_guide to help me install it.

4. Use list_models to see what models I have available.

5. Use search_templates to find the right workflow for my model.

6. Use get_prompting_guide to learn the correct prompting style for my model.

7. Use get_template to build a workflow and run_workflow to generate a test image.

> Tip: If you're using the ComfyUI Desktop app, it runs on port 8000. If you installed ComfyUI manually, change the port to 8188.


What is This?

This MCP server acts as a bridge between AI assistants and ComfyUI, the powerful node-based interface for Stable Diffusion and other generative AI models. It allows Claude and other MCP-compatible AI assistants to:

  • Run complex workflows with full control over every node and parameter
  • Compose custom workflows using node discovery and building tools
  • Create videos using AnimateDiff, Stable Video Diffusion, and other video models
  • Generate audio using Stable Audio and other audio models
  • Manage your queue - view, cancel, and interrupt jobs
  • Help you set up - download models, install ComfyUI, and configure everything

Key Features

Self-Configuring

The server automatically discovers your ComfyUI installation and detects what models and features are available. No manual configuration of capabilities required.

Works Without ComfyUI Running

Even if ComfyUI isn't installed or running, the server provides tools to:

  • Guide you through installation
  • Download models directly
  • Fetch example workflows from documentation

Workflow-First Architecture

All generation happens through run_workflow, giving you full control over the ComfyUI workflow. The server provides comprehensive tools for:

  • Templates: Pre-built workflows for common tasks
  • Node composition: Build custom workflows node by node
  • Validation: Check workflows before running

70+ Example Workflows

Comprehensive library of example workflows from the official ComfyUI documentation, split into easily discoverable entries:

  • Flux: Dev, Schnell, Checkpoint variants, Kontext, Fill, Redux, Canny, Depth, ControlNet
  • SDXL: Base, Refiner, ReVision (image-guided)
  • SD3.5: Separate encoders, Checkpoint, Medium, Turbo, ControlNet
  • ControlNet: Scribble, Depth, T2I-Adapter, Pose, Multiple combined
  • Inpainting/Outpainting: Basic, dedicated models, various techniques
  • Video: SVD, Mochi, LTX-Video, Hunyuan Video, Cosmos, Wan
  • And more: Stable Cascade, HiDream, Qwen Image, Audio generation

Template System

Three sources of workflow templates:

  • Built-in templates: Standard txt2img for SD1.5, SDXL, and Flux
  • Example workflows: 70+ from official ComfyUI docs
  • Custom templates: Save and reuse your successful workflows

Workflow Composition Tools

Build custom workflows programmatically:

  • build_node: Generate valid node JSON with proper defaults
  • get_node_info: Detailed node inputs/outputs with examples
  • find_nodes_by_type: Discover nodes by what they accept/produce
  • validate_workflow: Check validity before running

Quick Start Guide

Step 1: Install ComfyUI

Option A: Desktop App (Recommended for most users)

  1. Go to comfy.org/download
  2. Download for your platform (macOS, Windows, or Linux)
  3. Install and launch the application
  4. ComfyUI will automatically set up Python and dependencies

Option B: Manual Installation

# Clone the repository
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI

# Install dependencies (use a virtual environment recommended)
pip install -r requirements.txt

# Run ComfyUI
python main.py

Step 2: Download a Model

You need at least one checkpoint model. Here are popular options:

SDXL (Recommended - high quality, 1024x1024)

  • Download sd_xl_base_1.0.safetensors from HuggingFace
  • Place in ComfyUI/models/checkpoints/

Flux (State of the art quality)

SD 1.5 (Classic, fast, many LoRAs available)

  • Download v1-5-pruned-emaonly.safetensors from HuggingFace
  • Place in ComfyUI/models/checkpoints/

Step 3: Configure Your AI Assistant

Add the ComfyUI MCP server to your AI assistant's configuration.

Claude Desktop (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "comfyui": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--pull", "always",
        "-e", "COMFYUI_URL=http://host.docker.internal:8000",
        "ghcr.io/shawnrushefsky/comfyui-mcp:latest"
      ]
    }
  }
}

> Note: The ComfyUI Desktop app uses port 8000. If you're running ComfyUI manually, change the port to 8188.

Step 4: Start Generating!

  1. Make sure ComfyUI is running (http://localhost:8188 should show the UI)
  2. Restart Claude Desktop
  3. Ask Claude to generate an image:
Generate an image of a sunset over mountains using Flux

Claude will automatically:

  • Connect to your ComfyUI instance
  • Search for the right template
  • Build and validate a workflow
  • Execute and display the result

Installation

Prerequisites

  • ComfyUI (desktop app recommended) or manual installation
  • One or more checkpoint/model files
  • Docker (recommended) or Node.js 18+

Option 1: Docker (Recommended)

Works with any MCP-compatible AI assistant. The Docker image automatically pulls updates.

Claude Desktop

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "comfyui": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--pull", "always",
        "-e", "COMFYUI_URL=http://host.docker.internal:8000",
        "ghcr.io/shawnrushefsky/comfyui-mcp:latest"
      ]
    }
  }
}
Claude Code (CLI)

Add to .mcp.json in your project root:

{
  "mcpServers": {
    "comfyui": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--pull", "always",
        "-e", "COMFYUI_URL=http://host.docker.internal:8000",
        "ghcr.io/shawnrushefsky/comfyui-mcp:latest"
      ]
    }
  }
}

Or add globally via CLI:

claude mcp add comfyui --transport stdio -- docker run -i --rm --pull always -e COMFYUI_URL=http://host.docker.internal:8000 ghcr.io/shawnrushefsky/comfyui-mcp:latest
Cursor

Add to Cursor's MCP settings (Settings → MCP Servers):

{
  "comfyui": {
    "command": "docker",
    "args": [
      "run", "-i", "--rm", "--pull", "always",
      "-e", "COMFYUI_URL=http://host.docker.internal:8000",
      "ghcr.io/shawnrushefsky/comfyui-mcp:latest"
    ]
  }
}
Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "comfyui": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--pull", "always",
        "-e", "COMFYUI_URL=http://host.docker.internal:8000",
        "ghcr.io/shawnrushefsky/comfyui-mcp:latest"
      ]
    }
  }
}
Cline (VS Code Extension)

Add to Cline's MCP settings in VS Code:

{
  "comfyui": {
    "command": "docker",
    "args": [
      "run", "-i", "--rm", "--pull", "always",
      "-e", "COMFYUI_URL=http://host.docker.internal:8000",
      "ghcr.io/shawnrushefsky/comfyui-mcp:latest"
    ]
  }
}
Linux (Any Client)

On Linux, use --network=host instead of host.docker.internal:

{
  "mcpServers": {
    "comfyui": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--pull", "always",
        "--network=host",
        "ghcr.io/shawnrushefsky/comfyui-mcp:latest"
      ]
    }
  }
}
Port Configuration
  • ComfyUI Desktop app (macOS/Windows): Uses port 8000 by default
  • Manual ComfyUI installation: Uses port 8188 by default

Adjust the COMFYUI_URL environment variable accordingly:

  • Desktop app: http://host.docker.internal:8000
  • Manual install: http://host.docker.internal:8188

Option 2: From Source

git clone https://github.com/shawnrushefsky/comfyui-mcp.git
cd comfyui-mcp
npm install
npm run build

Then configure your MCP client to use the built server:

Claude Desktop:

{
  "mcpServers": {
    "comfyui": {
      "command": "node",
      "args": ["/path/to/comfyui-mcp/dist/index.js"]
    }
  }
}

Claude Code (.mcp.json):

{
  "mcpServers": {
    "comfyui": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/comfyui-mcp/dist/index.js"]
    }
  }
}

Tools Reference

Setup & Status Tools

get_status

Get the current status of ComfyUI connection and installation.

What's the status of ComfyUI?
get_install_guide

Get platform-specific installation instructions. Recommends the desktop app for most users.

| Parameter | Type | Description | |-----------|------|-------------| | platform | "auto" \| "macos" \| "windows" \| "linux" | Target platform |

How do I install ComfyUI on my Mac?
get_model_guide

Get detailed guidance on downloading and installing models.

| Parameter | Type | Description | |-----------|------|-------------| | modelType | "all" \| "checkpoint" \| "flux" \| "sdxl" \| "sd15" \| "lora" \| "controlnet" \| "vae" | Type of model |

How do I set up Flux models?

Template & Workflow Tools

search_templates

Search for workflow templates across built-in, example, and custom sources.

| Parameter | Type | Description | |-----------|------|-------------| | modelType | "sd15" \| "sdxl" \| "sd3" \| "flux" \| "any" | Filter by model type | | taskType | "txt2img" \| "img2img" \| "inpaint" \| ... | Filter by task type | | category | string? | Filter by category | | query | string? | Free text search | | includeBuiltIn | boolean? | Include built-in tem

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.