Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ComfyUI MCP Servergenerate a cinematic image of a futuristic city at sunset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ComfyUI MCP Server
An MCP (Model Context Protocol) server that lets Claude generate images using a local ComfyUI instance. Run Stable Diffusion, SDXL, and other models through natural conversation.
Prerequisites
Python 3.11+
ComfyUI running locally (default:
http://127.0.0.1:8188)At least one checkpoint model installed in ComfyUI
Installation
Configuration
Copy .env.example to .env and adjust as needed:
Available environment variables (all prefixed with COMFYUI_):
Variable | Default | Description |
|
| ComfyUI server URL |
|
| Local directory for saved images |
|
| Default checkpoint model |
|
| Default sampling steps |
|
| Default image width |
|
| Default image height |
|
| Default CFG scale |
Claude Desktop Setup
Add this to your claude_desktop_config.json:
Replace /path/to/comfyui-mcp-server with the actual path to your installation.
Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Available Tools
generate_image
Generate an image from a text prompt.
Parameter | Type | Default | Description |
| string | (required) | Text prompt describing the image |
| string |
| Things to avoid |
| string | config default | Checkpoint model name |
| int |
| Image width in pixels |
| int |
| Image height in pixels |
| int |
| Sampling steps |
| float |
| Classifier-free guidance scale |
| int |
| Random seed (-1 for random) |
list_models
List all available checkpoint models installed in ComfyUI. No parameters.
get_queue_status
Get the current ComfyUI queue status (pending, running, completed counts). No parameters.
get_generation
Look up details of a previous generation by its prompt ID.
Parameter | Type | Description |
| string | The prompt ID from generate_image |
Usage Examples
Once configured in Claude Desktop, use natural language:
Development
Running Tests
Linting and Type Checking
Running the Server Directly
Architecture
The server translates MCP tool calls into ComfyUI workflow submissions, polls for completion, and returns results.
License
MIT