ComfyUI MCP Server
Enables AI agents to generate and manipulate audio using ElevenLabs' voice synthesis and cloning capabilities through ComfyUI's API node runner.
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 a mountain lake"
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 connects AI assistants to ComfyUI for image, video, and audio generation. Works with Claude Desktop, Claude Code, and any MCP-compatible client.
What It Does
This server gives AI agents full control over ComfyUI — from one-call image generation to building complex multi-node workflows. It exposes 40+ tools organized into three tiers:
Quick Generation (one-call tools)
All parameters have sensible defaults. Only a prompt is required:
Tool | Description |
| Generate images from text (local SD/SDXL model) |
| Generate images using Flux (auto-detects GGUF/safetensors) |
| Transform an existing image with a prompt |
| Generate video from text (local LTX-Video model) |
| Animate an image into video (LTX-Video) |
| Generate video from text (local Wan 2.2 model) |
| Animate an image into video (Wan 2.2) |
| AI upscale with an upscale model |
| Fill masked regions with AI-generated content |
| DALL-E 3 image generation (cloud API) |
| GPT Image generation/editing (cloud API) |
| Sora 2 video generation (cloud API) |
| Merge multiple videos into one |
Any API Node (200+ cloud providers)
Run any of ComfyUI's 200+ API nodes in a single call — Kling, Runway, Luma, Stability, ElevenLabs, Gemini, Veo, Recraft, Minimax, and more:
list_api_nodes(query="kling")— discover available API nodesget_node_schema("KlingTextToVideoNode")— see inputs, types, defaultsrun_api_node(node_class="KlingTextToVideoNode", inputs='{"prompt": "..."}')— execute
Automatically inserts loader nodes for image/video/audio inputs and save nodes for outputs. Validates COMBO values, INT/FLOAT ranges, and required inputs before submitting.
Supports async execution for parallel jobs:
run_api_node(..., queue_only=true) # returns immediately with prompt_id
wait_for_jobs("id1,id2,id3") # waits for all concurrentlyCustom Workflows (multi-node graphs)
For complex workflows (ControlNet, multi-LoRA, regional prompting, IP-Adapter):
search_nodes(query="controlnet")— find relevant nodesget_node_schema("ControlNetApplyAdvanced")— understand inputs/outputscreate_workflow(template="txt2img")— start from a templateadd_node(workflow_id, "ControlNetLoader", ...)— add nodes incrementallysuggest_next(workflow_id)— see what's missingvalidate_workflow(workflow_id)— check for errorsexecute_workflow(workflow_id)— generate results
System & Utility Tools
Tool | Description |
| List installed models by folder (checkpoints, loras, etc.) |
| List valid sampler/scheduler names |
| ComfyUI system info (VRAM, version, etc.) |
| Current queue state |
| Generation history |
| Server logs |
| Upload an image to ComfyUI's input directory |
| Upload a mask image for inpainting |
| Get URL to view/download generated files |
| List files in ComfyUI directories |
| Copy generated files to input for reuse |
| Wait for multiple queued jobs concurrently |
Related MCP server: ComfyUI MCP Server
Prerequisites
ComfyUI
You need a running ComfyUI instance. Install it following the official instructions.
Make sure ComfyUI is running and accessible (default: http://127.0.0.1:8188).
Models (for local generation)
For local generation tools, you need models installed in ComfyUI:
SD/SDXL image (
text_to_image): Any SD/SDXL checkpoint inmodels/checkpoints/Flux image (
flux_text_to_image): A Flux diffusion model (safetensors inmodels/diffusion_models/or GGUF) +clip_l.safetensorsandt5xxlencoder inmodels/text_encoders/+ae.safetensorsVAE inmodels/vae/LTX-Video (
text_to_video,image_to_video): LTX-Video checkpoint + T5-XXL text encoderWan 2.2 video (
wan_text_to_video,wan_image_to_video): Wan 2.2 GGUF model +umt5_xxlencoder inmodels/text_encoders/+wan2.2_vae.safetensorsinmodels/vae/Upscaling (
upscale_image): Any upscale model inmodels/upscale_models/
All local tools auto-detect installed models. Use list_models() to see what's available.
Use list_models() through the MCP to see what's currently installed.
Comfy.org API Key (for cloud generation)
Cloud-based tools (dalle3_image, gpt_image_generate, sora_video_generate, run_api_node) require a Comfy.org API key with credits loaded. Set it via the COMFY_API_KEY environment variable.
Installation
From source
git clone https://github.com/halbert04/comfyui-mcp.git
cd comfyui-mcp
pip install .For development:
pip install -e ".[dev]"Verify installation
comfyui-mcp --helpConfiguration
All configuration is via environment variables:
Variable | Default | Description |
|
| ComfyUI server URL |
|
| Max wait time for job completion (seconds) |
|
| Polling interval for job status (seconds) |
| (empty) | Comfy.org API key for cloud API nodes |
|
| Transport mode: |
|
| Host for HTTP transport |
|
| Port for HTTP transport |
Usage with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"comfyui": {
"command": "comfyui-mcp",
"env": {
"COMFYUI_URL": "http://127.0.0.1:8188",
"COMFYUI_TIMEOUT": "900",
"COMFY_API_KEY": "your-comfy-api-key-here"
}
}
}
}Restart Claude Desktop after saving. The ComfyUI tools will appear in the tool list.
Usage with Claude Code
Add the MCP server to your Claude Code configuration:
claude mcp add comfyui -- comfyui-mcpOr with environment variables:
claude mcp add comfyui -e COMFYUI_URL=http://127.0.0.1:8188 -e COMFY_API_KEY=your-key -- comfyui-mcpUsage as HTTP Server
For non-stdio clients, run as an HTTP server:
COMFYUI_MCP_TRANSPORT=streamable-http comfyui-mcpThis starts an MCP server on http://127.0.0.1:8200 that any MCP client can connect to.
Project Structure
src/comfyui_mcp/
server.py # MCP server entry point and tool registration
client.py # HTTP client for ComfyUI API
config.py # Environment variable configuration
workflows.py # Workflow graph builder and templates
node_cache.py # Cached node schema from /object_info
polling.py # Job completion polling
tools/
generate.py # One-call generation tools
api_runner.py # Generic API node runner (run_api_node, list_api_nodes)
builder.py # Workflow builder tools (create, add_node, execute, etc.)
discovery.py # Node discovery tools (search_nodes, get_node_schema)
models.py # Model listing tools
system.py # System info, queue, history, file browsing
resources/
resources.py # MCP resources (workflow templates, system info)Development
Run tests:
pip install -e ".[dev]"
pytestLicense
MIT
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
- 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/halbert04/comfyui-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server