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 "Deploy 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 Server Generate 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 Hub
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
Available Tools
46 toolsadd_nodeA
Add a node to a workflow with auto-connection of typed inputs.
Inputs: class_type (required), workflow_id (required), inputs. Returns: object
cancel_jobA
Cancel the currently running ComfyUI job.
Inputs: no named parameters. Returns: object
clear_queueA
Clear all pending items from the ComfyUI queue.
Inputs: no named parameters. Returns: object
copy_output_to_inputA
Copy a file from ComfyUI's output directory to input directory.
Makes generated files (images, videos, audio) available as inputs for subsequent workflows. For example, copy a generated image to use it in image_to_image, image_to_video, or run_api_node.
Inputs: filename (required), new_name, subfolder. Returns: object
create_workflowB
Create a new workflow, optionally from a template.
Inputs: name, template, overrides. Returns: object
dalle3_imageA
Generate an image using DALL-E 3 via Comfy.org API.
All parameters except prompt are optional. Requires COMFY_API_KEY. For other API providers, use run_api_node() with list_api_nodes().
Inputs: prompt (required), seed, size, style, +1 more. Returns: object
delete_history_itemsA
Delete specific items from ComfyUI execution history.
Inputs: prompt_ids (required). Returns: object
delete_queue_itemsB
Delete specific items from the ComfyUI queue.
Inputs: prompt_ids (required). Returns: object
execute_workflowB
Execute a workflow that was built with builder tools.
Inputs: workflow_id (required), wait. Returns: object
flux_text_to_imageA
Generate images using Flux (local model).
All parameters except prompt are optional with sensible defaults. Auto-detects installed Flux model (GGUF or safetensors) and CLIP encoders. Produces high-quality 1024x1024 images by default.
Inputs: prompt (required), seed, steps, width, +7 more. Returns: object
free_memoryC
Free ComfyUI VRAM and RAM.
Inputs: free_memory, unload_models. Returns: object
get_featuresA
Get ComfyUI server feature flags and capabilities.
Returns: Dict of supported features (preview metadata, max upload size, extensions, node replacements, etc.).
Inputs: no named parameters. Returns: object
get_historyB
Get ComfyUI execution history.
Inputs: max_items, prompt_id. Returns: object
get_image_urlB
Get the URL to view or download a ComfyUI image/video/audio.
Inputs: filename (required), subfolder, folder_type. Returns: result
get_job_statusB
Get the status and outputs of a queued ComfyUI job.
Inputs: prompt_id (required). Returns: object
get_logsA
Get recent ComfyUI server log entries for debugging.
Inputs: max_entries. Returns: result
get_model_metadataA
Get metadata from a safetensors model file.
Useful for inspecting what a model was trained on, its configuration, resolution, license, etc.
Inputs: folder (required), filename (required). Returns: object
get_node_schemaA
Get the full input/output schema for a ComfyUI node class.
Inputs: class_type (required). Returns: object
get_queueA
Get the current ComfyUI queue with running and pending items.
Inputs: no named parameters. Returns: object
get_result_imagesA
Get all output images from a completed ComfyUI job.
Inputs: prompt_id (required). Returns: result
get_system_statsA
Get ComfyUI system information including OS, RAM, VRAM, and device info.
Inputs: no named parameters. Returns: object
get_workflowA
Get the full workflow graph state with type information.
Inputs: workflow_id (required). Returns: object
gpt_image_generateA
Generate or edit an image using GPT Image via Comfy.org API.
Can generate from text alone, or edit an existing image with a prompt. All parameters except prompt are optional. Requires COMFY_API_KEY.
Inputs: prompt (required), n, seed, size, +4 more. Returns: object
image_to_imageB
Transform an existing image guided by a text prompt.
All parameters except prompt and input_image are optional with sensible defaults. Change any parameter to customize.
Inputs: prompt (required), input_image (required), cfg, seed, +8 more. Returns: object
image_to_videoA
Generate a video from an image using LTX-Video (local model).
All parameters except prompt and input_image are optional with sensible defaults. Change any parameter to customize. For cloud-based I2V, use sora_video_generate(input_image=...) or run_api_node() with Kling/Runway/Luma/etc.
Inputs: prompt (required), input_image (required), cfg, seed, +9 more. Returns: object
inpaintA
Fill in masked regions of an image with AI-generated content.
All parameters except prompt, input_image, and mask_image are optional with sensible defaults. Change any parameter to customize.
Inputs: prompt (required), mask_image (required), input_image (required), cfg, +8 more. Returns: object
list_api_nodesA
List available API nodes (Kling, Runway, Luma, Stability, ElevenLabs, etc.).
These are cloud-based nodes that run via the Comfy.org API proxy. Use get_node_schema(name) to see full input/output details, then run_api_node(name, inputs) to execute.
Inputs: query, output_type. Returns: result
list_filesB
List files in a ComfyUI directory.
Inputs: directory_type. Returns: result
list_modelsB
List available models in ComfyUI.
Inputs: folder. Returns: result
list_samplers_and_schedulersA
List all available sampler algorithms and noise schedulers.
Returns a dict with 'samplers' and 'schedulers' lists.
Inputs: no named parameters. Returns: object
merge_videosA
Merge multiple videos into a single video.
Decomposes each video into frames and audio, batches the frames together, combines the audio tracks, and reassembles into one video.
Inputs: video_files (required), fps, audio_mode, output_prefix. Returns: object
remove_nodeA
Remove a node from a workflow and clean up dangling connections.
Inputs: node_id (required), workflow_id (required). Returns: object
run_api_nodeA
Run any ComfyUI node in a single call.
Builds a minimal workflow around the node, auto-inserting loader and save nodes as needed. Works with all 200+ API nodes (Kling, Runway, Luma, Stability, ElevenLabs, Gemini, etc.) and any built-in node.
Workflow: discover nodes with list_api_nodes() or search_nodes(), check inputs with get_node_schema(), then run with this tool.
For IMAGE/VIDEO/AUDIO-typed inputs, pass a filename string (e.g. "photo.png") and a LoadImage/LoadVideo/LoadAudio node is auto-inserted.
Inputs: node_class (required), inputs, timeout, queue_only, +1 more. Returns: object
search_nodesA
Search ComfyUI nodes by name, category, or input/output type.
Inputs: query, category, input_type, output_type. Returns: result
set_inputsB
Update inputs on an existing workflow node.
Inputs: inputs (required), node_id (required), workflow_id (required). Returns: object
sora_video_generateA
Generate a video using Sora 2 via Comfy.org API.
Can generate from text alone, or animate an existing image. All parameters except prompt are optional. Requires COMFY_API_KEY.
Inputs: prompt (required), seed, size, model, +2 more. Returns: object
suggest_nextA
Analyze a workflow and suggest next steps.
Checks for unconnected inputs, unused outputs, missing output nodes, and provides context-aware suggestions.
Inputs: workflow_id (required). Returns: object
text_to_imageB
Generate images from a text description.
All parameters except prompt are optional with sensible defaults. Change any parameter to customize the generation.
Inputs: prompt (required), cfg, seed, steps, +9 more. Returns: object
text_to_videoA
Generate a video from a text description using LTX-Video (local model).
All parameters except prompt are optional with sensible defaults. Change any parameter to customize. For cloud-based video generation, use sora_video_generate() or run_api_node() with Kling/Runway/Luma/etc.
Inputs: prompt (required), cfg, seed, steps, +7 more. Returns: object
upload_imageA
Upload a local image file to ComfyUI's input directory.
Inputs: image_path (required), overwrite, subfolder. Returns: object
upload_maskA
Upload a mask image to ComfyUI's input directory.
The mask is processed to extract the alpha channel for use with inpainting workflows. White areas in the mask will be inpainted.
Inputs: image_path (required), overwrite, subfolder, original_ref. Returns: object
upscale_imageC
Upscale an image using an AI upscaling model.
Inputs: input_image (required), upscale_model. Returns: object
validate_workflowA
Validate a workflow for correctness without executing it.
Checks: all node class_types exist, required inputs connected, connection type compatibility, output node exists.
Inputs: workflow_id (required). Returns: object
wait_for_jobsA
Wait for multiple queued jobs to complete and return all results.
Use this after queueing multiple jobs with queue_only=true to wait for all of them at once, enabling parallel execution.
Inputs: prompt_ids (required), timeout. Returns: object
wan_image_to_videoA
Generate video from an image using Wan 2.2 (local model).
All parameters except prompt and input_image are optional with sensible defaults. Auto-detects installed Wan model and encoder.
Inputs: prompt (required), input_image (required), cfg, seed, +11 more. Returns: object
wan_text_to_videoA
Generate video from text using Wan 2.2 (local model).
All parameters except prompt are optional with sensible defaults. Auto-detects installed Wan model and UMT5-XXL text encoder.
Inputs: prompt (required), cfg, seed, steps, +10 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 46 tools
Many tools have overlapping purposes, especially the image generation suite (text_to_image, flux_text_to_image, dalle3_image, gpt_image_generate) and video generation suite (text_to_video, wan_text_to_video, sora_video_generate). Job-related tools like get_job_status, get_result_images, and wait_for_jobs also have fuzzy boundaries that could cause misselection.
Tool names predominantly follow a clear verb_noun snake_case pattern (get_queue, create_workflow, upload_image) with consistent use of get_/list_/create_/delete_ prefixes. Minor exceptions like 'inpaint' and 'suggest_next' deviate slightly, but the overall pattern is predictable and readable.
With 46 tools, the server is heavily over-scoped. While it covers many subdomains, the generation tools are redundant and could be consolidated into generic tools with provider/model parameters. The workflow builder and API node tools add bulk but are useful for advanced users.
The tool set provides comprehensive coverage of ComfyUI operations: queue management, system stats, multiple generation paths, file handling, workflow construction/validation/execution, and cloud API node access. Minor gaps like no dedicated audio generation or workflow listing tools exist, but run_api_node covers arbitrary node types.
Related MCP Connectors
Image and video AI tools and your own pipelines, run from any AI assistant.
Remote MCP for RunComfy: ComfyUI deployments, hosted models, LoRA training. 31 tools.
Connect CNAPS Studio to Claude or ChatGPT, then just say what you want. "Upscale this photo 4x" or "remove the background and make it a short video". It picks the models, builds the flow, runs it, and gives you the file back in the same chat. 80+ AI models and 80+ tools for image, video and audio. Sign in with your CNAPS account (OAuth), no API key needed. n8n and Zapier work too. Setup guide: https://docs.cnaps.ai/ai-assistant
Build and run visual creative-production workflows from your AI agent.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to generate and iteratively refine images, audio, and video by interacting with a local ComfyUI instance through natural conversation. It provides comprehensive tools for workflow management, node introspection, and publishing generated assets.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceGive AI agents full control over your local ComfyUI by exposing 77 tools for workflow management, image generation, model handling, and real-time canvas control.4AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to generate images using ComfyUI by exposing tools for image generation, batch processing, and status checking through the Model Context Protocol.MIT
- AlicenseBqualityCmaintenanceEnables discovery of ComfyUI nodes and building/managing workflows with real-time execution via WebSocket. Provides 50+ tools for node discovery, workflow building, template usage, model management, and batch/chain execution.61157 npm4MIT