comfyui-mcp-server
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 an image of a sunset over mountains"
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 enables AI assistants like Claude to generate images using ComfyUI.
Features
Generate Images: Create images from text prompts using your ComfyUI workflow
Automatic File Handling: Optionally copy generated images directly to your project
Status Checking: Verify ComfyUI is running before generating
List Images: Browse previously generated images
Related MCP server: ComfyUI MCP Server
Prerequisites
ComfyUI running locally on
http://127.0.0.1:8188Z-Image Turbo model (or modify
workflow.jsonfor your model)Python 3.10+
Claude Code or another MCP-compatible client
Installation
1. Clone the repository
git clone https://github.com/sumitchatterjee13/comfyui-mcp-server.git2. Install dependencies
cd path/to/comfyui-mcp
pip install -r requirements.txtOr with uv (recommended):
uv pip install -r requirements.txt3. Configure your MCP client
Add this server to your MCP client configuration. Examples for popular clients below.
Claude Code — global config (~/.claude.json):
{
"mcpServers": {
"comfyui": {
"command": "python",
"args": [
"C:/Users/YourName/mcp-servers/comfyui-mcp/server.py",
"--comfyui-url", "http://127.0.0.1:8188"
]
}
}
}Claude Code — project-level config (.mcp.json in your project root):
{
"mcpServers": {
"comfyui": {
"command": "python",
"args": [
"C:/Users/YourName/mcp-servers/comfyui-mcp/server.py",
"--comfyui-url", "http://127.0.0.1:8188"
]
}
}
}Cursor / Kilo Code / Cline / Roo Code — MCP settings JSON:
{
"mcpServers": {
"comfyui": {
"command": "python",
"args": [
"server.py",
"--comfyui-url", "http://127.0.0.1:8188"
],
"cwd": "C:/Users/YourName/mcp-servers/comfyui-mcp",
"alwaysAllow": [
"generate_image",
"batch_generate_images",
"check_batch_status",
"list_generated_images",
"check_comfyui_status",
"convert_to_webp",
"batch_convert_to_webp"
]
}
}
}Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"comfyui": {
"command": "python",
"args": [
"C:/Users/YourName/mcp-servers/comfyui-mcp/server.py",
"--comfyui-url", "http://127.0.0.1:8188"
]
}
}
}Notes:
Replace the paths with the actual location of your
comfyui-mcpfolder.
--comfyui-urlis optional (defaults tohttp://127.0.0.1:8188). Use it to point to ComfyUI on a different port, a LAN machine (http://192.168.1.50:8188), or a cloud instance.The URL can also be set via the
COMFYUI_URLenvironment variable.
alwaysAllowis supported by Cursor/Kilo Code/Cline/Roo Code to auto-approve tool calls without prompting each time.
cwdlets you use a relative path forserver.pyinstead of an absolute one.
Usage
Once configured, you can ask Claude to generate images naturally:
Basic generation
"Generate an image of a sunset over mountains"
With specific dimensions
"Create a 1920x1080 hero banner image of a modern tech office"
Save to project
"Generate a product mockup image and save it to ./public/images/product.png"
Check status
"Is ComfyUI running?"
List previous images
"Show me the last 5 images I generated"
Available Tools
generate_image
Generate an image from a text prompt.
Parameters:
Parameter | Type | Default | Description |
| string | required | Description of the image to generate |
| string | required | Full output path (no extension, forward slashes) |
| int | 1024 | Image width in pixels (256-4096) |
| int | 1024 | Image height in pixels (256-4096) |
| int | random | Seed for reproducible generation |
| string | "jpg" | Output format: jpg, webp, or png |
batch_generate_images
Queue multiple images (up to 100) for generation. This tool is non-blocking — it queues all images to ComfyUI and returns a batch_id immediately. Use check_batch_status to monitor progress.
Parameters:
Parameter | Type | Default | Description |
| list | required | Array of 1-100 image requests (see below) |
Each image request:
Parameter | Type | Default | Description |
| string | required | Description of the image |
| string | required | Unique output path (no extension) |
| int | 1024 | Image width in pixels (256-4096) |
| int | 1024 | Image height in pixels (256-4096) |
| int | random | Seed for reproducible generation |
| string | "jpg" | Output format: jpg, webp, or png |
Two-step workflow:
Call
batch_generate_images→ returnsbatch_idimmediatelyCall
check_batch_statuswith thebatch_id→ returns progressRepeat step 2 until status is
"completed"
Example usage:
"Generate 5 product images for the e-commerce site: a leather bag, sneakers, a watch, sunglasses, and a jacket"
check_batch_status
Check the progress of a batch image generation job. Returns current status, completed count, pending count, and results of finished images.
Parameters:
Parameter | Type | Default | Description |
| string | required | The batch_id from batch_generate_images |
list_generated_images
List recently generated images.
Parameters:
Parameter | Type | Default | Description |
| string | required | Directory path to list images from |
| int | 10 | Maximum images to return |
check_comfyui_status
Check if ComfyUI is running and accessible. No parameters needed.
Workflow Customization
The included workflow.json is configured for the Z-Image Turbo model. To use a different workflow:
Export your workflow from ComfyUI (Save → API Format)
Replace
workflow.jsonUpdate the node mappings in
server.pyif needed:Node 7: Positive prompt (
textfield)Node 11: Dimensions (
width,heightfields)Node 6: Seed (
seedfield)Node 12: Output (
filename_prefixfield)
Troubleshooting
"Cannot connect to ComfyUI"
Ensure ComfyUI is running
Check it's accessible at http://127.0.0.1:8188
Verify no firewall is blocking the connection
"Image file not found"
Check that the save_path directory exists or is writable
Verify ComfyUI has write permissions to the output folder
Generation seems stuck
Check ComfyUI's web interface for errors
Verify your model and VAE are loaded correctly
The default timeout is 300 seconds (5 minutes)
Tips for Better Results
The Z-Image Turbo model responds well to:
Detailed descriptions: "A serene mountain lake at golden hour, snow-capped peaks reflected in still water, photorealistic"
Style specifications: "...in the style of watercolor illustration" or "...digital art, trending on artstation"
Composition guidance: "wide angle shot", "close-up portrait", "bird's eye view"
Lighting details: "dramatic lighting", "soft diffused light", "backlit silhouette"
Since this model doesn't use negative prompts, focus on describing what you want rather than what you don't want.
License
MIT License - feel free to modify and share.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sumitchatterjee13/comfyui-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server