comfyui-mcp
This server acts as an MCP bridge to ComfyUI, enabling AI image generation and manipulation from any MCP-compatible client (Claude Code, Claude Desktop, etc.) using natural language prompts.
Image Generation
generate_image– Generate an image from a text prompt with control over dimensions, steps, CFG, seed, and checkpointgenerate_variations– Produce multiple variations (2–16) of the same prompt by varying the seedgenerate_with_workflow– Submit a fully custom ComfyUI node graph (exported via "Save (API Format)") for custom pipelinesgenerate_with_controlnet– Generate images conditioned on a preprocessed ControlNet image (pose, depth, edges, etc.) with adjustable strengthgenerate_with_ip_adapter– Use a reference image as a visual/style guide via IP-Adapter with various presets and weight control
Image Editing & Enhancement
refine_image– Run img2img on a source image with a new prompt and adjustable denoise strengthupscale_image– Upscale an image using ESRGAN, SwinIR, or other installed upscaler models
Asset & Model Discovery
list_models– List available checkpoints, LoRAs, samplers, schedulers, and upscalers on the connected ComfyUI instancelist_workflows– List built-in workflow templates (txt2img, img2img, upscale, controlnet, ip_adapter)upload_image– Upload a reference image to ComfyUI from a URL or base64 data for use in workflows
Workflow Template Registry
save_workflow_template– Save a custom workflow JSON under a named slot for reuselist_workflow_templates– List all saved templates with descriptions and timestampsget_workflow_template– Retrieve a saved template's JSON and metadatadelete_workflow_template– Remove a saved templaterun_workflow_template– Execute a previously saved workflow template and return image URLs
The server also provides an image proxy endpoint, making ComfyUI-generated image URLs accessible to MCP clients even when ComfyUI is not directly reachable. Both streamable HTTP and stdio transports are supported.
Supports running the MCP server in a Docker container, enabling easy deployment and isolation of the image generation service alongside ComfyUI instances.
Hosts the project repository and provides access to the MCP server source code, documentation, and issue tracking for development and community contributions.
Accepts financial support for ongoing development, maintenance, and future enhancements of the ComfyUI MCP server through GitHub's sponsorship platform.
Accepts financial support for ongoing development, maintenance, and future enhancements of the ComfyUI MCP server through Ko-fi donations.
Provides package distribution and installation of the MCP server through npm registry, enabling easy installation and updates via npm or npx.
comfyui-mcp
MCP server for ComfyUI. Generate images from natural language prompts in any MCP-compatible client.
Status
v0.2 ships the core tools plus upscale, an image proxy, and public-URL support. Current tool surface: generate_image, generate_variations, generate_with_workflow, refine_image, upscale_image, list_models, list_workflows, upload_image, generate_with_controlnet, generate_with_ip_adapter, plus a workflow template registry. See Roadmap for what's next.
Related MCP server: ComfyUI MCP
Install
npx (no install required)
npx @miller-joe/comfyui-mcp --comfyui-url http://your-comfyui-host:8188npm
npm install -g @miller-joe/comfyui-mcp
comfyui-mcp --comfyui-url http://your-comfyui-host:8188Docker
docker run -p 9100:9100 \
-e COMFYUI_URL=http://your-comfyui-host:8188 \
ghcr.io/miller-joe/comfyui-mcp:latestConnect an MCP client
Claude Code:
claude mcp add --transport http comfyui http://localhost:9100/mcpOr register the streamable HTTP endpoint with an MCP gateway (e.g. MetaMCP) to aggregate with other servers.
Configuration
All options can be set via CLI flag or environment variable:
CLI flag | Env var | Default | Description |
|
|
| Bind host (HTTP mode only) |
|
|
| Bind port (HTTP mode only) |
|
| (unset) | Speak MCP over stdio instead of HTTP. Use when launched as a subprocess by a stdio-first MCP client (Claude Desktop, mcp-inspector). |
|
|
| ComfyUI HTTP URL used internally by this server |
|
| same as | External URL in image URLs returned to clients. Set this when the internal URL is not reachable from MCP clients (common with Docker networks). |
(no flag) |
|
| Default checkpoint filename |
Transports
The server speaks streamable HTTP by default (great for Claude Code, MetaMCP, raw fetch). Pass --stdio (or set MCP_TRANSPORT=stdio) to switch into stdio mode, which is what stdio-first clients like Claude Desktop and the MCP Inspector expect:
# Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"comfyui": {
"command": "npx",
"args": ["-y", "@miller-joe/comfyui-mcp", "--stdio", "--comfyui-url", "http://127.0.0.1:8188"]
}
}
}Image URLs returned to clients
Generation tools return image URLs like <comfyui-public-url>/view?filename=…. If --comfyui-public-url is not set, URLs use the internal --comfyui-url value.
The server also exposes a proxy endpoint: GET /images/<filename>?subfolder=&type=output streams the image bytes through this server, which is useful when clients can reach the MCP server but not ComfyUI directly.
The default checkpoint must match a file in your ComfyUI models/checkpoints/ directory. Override via COMFYUI_DEFAULT_CKPT or pass checkpoint as a tool argument.
Tools
generate_image
Generate an image from a text prompt using ComfyUI's default txt2img workflow.
Parameters: prompt (required), negative_prompt, width, height, steps, cfg, seed, checkpoint.
generate_variations
Generate multiple variations of the same prompt by varying the seed. Returns all images at once.
Parameters: prompt (required), count (2–16, default 4), plus the same generation params as generate_image, with base_seed instead of seed.
generate_with_workflow
Submit an arbitrary ComfyUI workflow JSON (full node graph) and return the resulting image URLs. Use this for custom workflows — ControlNet, upscaling, or anything exported from ComfyUI's Save (API Format).
Parameter: workflow (object), the complete node graph.
refine_image
Run img2img on a source image. The server fetches a source URL, uploads it to ComfyUI, and runs a denoising pass guided by a new prompt. Lower denoise preserves more of the original; higher gives the prompt more freedom.
Parameters: prompt, source_image_url (required), denoise (0–1, default 0.5), plus standard generation params.
list_models
List available checkpoints, LoRAs, samplers, or schedulers on the ComfyUI instance.
Parameter: kind, one of checkpoints (default), loras, samplers, schedulers.
list_workflows
List built-in workflow templates shipped with this server (currently txt2img, img2img, upscale, controlnet, ip_adapter).
upload_image
Upload a reference image to ComfyUI for use in img2img, ControlNet, or IP-Adapter workflows.
Parameters: source_url or image_base64 (one required), filename (optional), overwrite (default false).
Returns: the stored filename, which can be used as the image input in workflow nodes like LoadImage.
generate_with_controlnet
Generate an image conditioned by a ControlNet preprocessed image (pose skeleton, depth map, canny edges, normal map, etc.) plus a text prompt.
Parameters: prompt, control_image_url (the preprocessed conditioning image; this tool doesn't run preprocessors), controlnet_model (filename from models/controlnet/), strength (0–2, default 1), start_percent / end_percent (0–1, controlling when CN is active during sampling), plus standard generation params.
Requires a ControlNet model installed in your ComfyUI models/controlnet/ directory.
generate_with_ip_adapter
Generate an image using a reference image as a visual/style/subject guide via IP-Adapter.
Parameters: prompt, reference_image_url, preset (e.g. "STANDARD (medium strength)", "PLUS FACE (portraits)", "VIT-G (medium strength)"), weight (0–3, default 1), start_at / end_at (0–1), plus standard generation params.
Requires the ComfyUI-IPAdapter-plus custom node pack plus the preset's matching IPAdapter weights and CLIP Vision models.
Workflow template registry
Save complex workflow JSON once, run by name later. Templates are stored on disk under --templates-dir (defaults to ~/.config/comfyui-mcp/templates/<name>.json) so they survive restarts and are portable across MCP clients.
Tool | Description |
| Save a workflow JSON under a named slot. |
| List saved templates with descriptions and last-updated timestamp. |
| Fetch a stored template's JSON plus metadata. |
| Delete a stored template. |
| Run a saved template against ComfyUI and return image URLs. |
Template names must start alphanumeric. Allowed: a-z, A-Z, 0-9, -, _. Max 64 chars.
Return format
All generation tools return image URLs served directly by the ComfyUI instance (http://<comfyui>/view?filename=…). These URLs can be passed straight to any client that accepts image URLs.
Architecture
┌────────────────┐ ┌──────────────────┐ ┌──────────────┐
│ MCP client │────▶│ comfyui-mcp │────▶│ ComfyUI │
│ (Claude, etc.)│◀────│ (this server) │◀────│ instance │
└────────────────┘ └──────────────────┘ └──────────────┘
streamable HTTP HTTP REST + pollThe server is stateless. A single MCP request submits a workflow to ComfyUI, polls /history/{id} until complete, and returns image URLs.
Development
git clone https://github.com/miller-joe/comfyui-mcp
cd comfyui-mcp
npm install
npm run dev # hot-reload via tsx watch
npm run build # compile TS to dist/
npm run typecheck # strict type checkingRequires Node 20+.
Roadmap
Shipped in v0.2:
generate_image,generate_variations,generate_with_workflowrefine_image(img2img from a source URL)upscale_image(ESRGAN / SwinIR-style model upscale)list_models,list_workflows,upload_imageImage proxy endpoint (
/images/<filename>) for clients that can't reach ComfyUI directlyConfigurable public URL for externally-correct image URLs
Workflow template registry (save/list/get/delete/run)
generate_with_controlnet(requires ControlNet models on the ComfyUI side)generate_with_ip_adapter(requires ComfyUI-IPAdapter-plus pack)
Planned:
WebSocket progress events for long-running generations.
License
MIT © Joe Miller
Support
If this tool saves you time, consider supporting development:
Every contribution funds maintenance, documentation, and the next release.
Available Tools
15 toolsdelete_workflow_templateB
Delete a saved workflow template.
Inputs: name (required).
generate_imageB
Generate an image from a text prompt using ComfyUI's default txt2img workflow. Returns one or more image URLs served directly by the ComfyUI instance.
Inputs: prompt (required), negative_prompt, width, height, +4 more.
generate_variationsB
Generate multiple variations of the same prompt by varying the seed. Useful for picking the best result or exploring a concept.
Inputs: prompt (required), count, negative_prompt, width, +5 more.
generate_with_controlnetA
Generate an image conditioned by a ControlNet preprocessed image (pose, depth, canny, etc.) plus a prompt. Requires a ControlNet model installed in ComfyUI's models/controlnet/ directory. The control_image_url must already be the preprocessed conditioning image — this tool does not run preprocessors itself.
Inputs: prompt (required), control_image_url (required), controlnet_model (required), negative_prompt, +9 more.
generate_with_ip_adapterB
Generate an image using a reference image as an IP-Adapter visual/style/subject guide. Requires the ComfyUI-IPAdapter-plus custom node pack and the preset's matching models (IPAdapter weights + CLIP vision). Weight tunes how strongly the reference guides generation.
Inputs: prompt (required), reference_image_url (required), negative_prompt, preset, +9 more.
generate_with_workflowA
Submit an arbitrary ComfyUI workflow (full node graph) and return the resulting image URLs. Use this when you need a custom workflow like ControlNet, upscaling, or a node graph exported from ComfyUI's 'Save (API Format)'.
Inputs: workflow (required).
get_workflow_templateB
Fetch a saved workflow template's JSON and metadata.
Inputs: name (required).
list_modelsA
List available models or samplers on the ComfyUI instance. Use this to discover valid values for the 'checkpoint' parameter of other tools, or to see what LoRAs and samplers are installed.
Inputs: kind.
list_workflowsA
List built-in workflow templates shipped with this MCP server. These are the named workflows that can be used as a baseline; for arbitrary workflows use generate_with_workflow.
Inputs: no named parameters.
list_workflow_templatesA
List all saved workflow templates in the registry.
Inputs: no named parameters.
refine_imageA
Refine an existing image using img2img: fetch the source image, upload it to ComfyUI, and run a denoising pass guided by the prompt. Lower denoise preserves more of the original; higher denoise gives more freedom to the prompt.
Inputs: prompt (required), source_image_url (required), denoise, negative_prompt, +4 more.
run_workflow_templateB
Run a saved workflow template against ComfyUI and return the resulting image URLs.
Inputs: name (required).
save_workflow_templateA
Save a ComfyUI workflow JSON to the server's template registry under a named slot. Overwrites are disabled by default.
Inputs: name (required), workflow (required), description, overwrite.
upload_imageA
Upload a reference image to ComfyUI for use in img2img, ControlNet, or IP-Adapter workflows. Accepts either a source URL (will be fetched) or base64-encoded image data. Returns the stored filename for use as 'image' in workflow nodes like LoadImage.
Inputs: source_url, image_base64, filename, overwrite.
upscale_imageA
Upscale an image using a loaded upscaler model (ESRGAN, SwinIR, etc.). Fetches the source image, uploads to ComfyUI, runs the upscale node, and returns the output URL. Requires at least one upscaler model in ComfyUI's models/upscale_models/ directory.
Inputs: source_image_url (required), upscale_model (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a clearly distinct purpose: generation methods (standard, variations, ControlNet, IP-Adapter, custom workflow), image manipulation (refine, upscale), workflow management (list, get, save, delete, run templates), and utilities (upload_image, list_models). No overlap in functionality.
All tools follow a consistent verb_noun pattern in snake_case (e.g., generate_image, list_models, save_workflow_template). No mixing of styles or ambiguous verbs.
15 tools cover the core capabilities of a ComfyUI integration (generation, conditioning, upscaling, workflow templates, and utilities) without being excessive. Each tool earns its place for a comprehensive image generation server.
The tool surface covers major workflows: txt2img, img2img, ControlNet, IP-Adapter, upscaling, and custom workflows via templates. Minor gaps like explicit inpainting/outpainting tools exist, but these can be handled through custom workflows.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
Remote MCP for RunComfy: ComfyUI deployments, hosted models, LoRA training. 31 tools.
MCP server for Flux AI image generation
MCP server for Wan AI video generation
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude Desktop to interact with local ComfyUI installations for AI-powered image generation, including workflow management, model selection, real-time monitoring, and custom workflow execution through natural language.1411,925 npm18MIT
- AlicenseAqualityAmaintenanceMCP server + Claude Code plugin for ComfyUI: execute workflows, generate images, visualize pipelines as Mermaid diagrams, compose/validate workflows, manage and download models, control VRAM, and explore custom nodes. 36 tools, cross-platform, installs via npx -y comfyui-mcp.4111,925 npm906MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that connects local ComfyUI to AI agents, enabling natural language control of ComfyUI for creating workflows, generating images, and managing the queue.1-
- AlicenseAqualityDmaintenanceMCP server that provides image generation, captioning, and tagging via ComfyUI API, configurable for agent tools.43MIT