ComfyUI MCP Server
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 castle using a txt2img workflow"
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 server for interacting with ComfyUI instances running on your local network. This server provides tools for generating images and checking generation status through ComfyUI's API.
Installation
Clone this repository
Install dependencies:
npm installBuild the server:
npm run buildRelated MCP server: comfyui-mcp
Configuration
The server requires the following environment variables:
COMFYUI_SERVER_URL(optional): The URL of your ComfyUI instance. Defaults tohttp://127.0.0.1:8188
MCP Tools
generate_image
Generates an image using a ComfyUI workflow.
Parameters:
workflow(required): A ComfyUI workflow JSON objectwait(optional): Whether to wait for the image generation to complete. Defaults to true
Example:
const result = await mcp.useTool('comfyui-server', 'generate_image', {
workflow: {
"3": {
"inputs": {
"seed": 5,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": ["4", 0],
"positive": ["6", 0],
"negative": ["7", 0],
"latent_image": ["5", 0]
},
"class_type": "KSampler"
},
// ... rest of your workflow
}
});Returns:
{
"promptId": "abc123",
"imagePath": "temp/ComfyUI_00042.png"
}check_status
Check the status of a prompt.
Parameters:
promptId(required): The prompt ID to check
Example:
const status = await mcp.useTool('comfyui-server', 'check_status', {
promptId: "abc123"
});Returns:
{
"status": {
"completed": true,
"executing": false
},
"hasImages": true
}Development
To run the server in development mode with automatic reloading:
npm run devNotes
Generated images are saved in a
tempdirectory in the current working directoryThe server will automatically clean up old images on startup
Requests will timeout after 5 minutes if the image generation doesn't complete
Available Tools
3 toolscheck_statusB
Check the status of a prompt. Example: {"promptId": "abc123-def456-ghi789"}
Inputs: promptId (required).
copy_imageA
Copy an image from ComfyUI output to a project location. Example: {"sourcePath": "\\LAWLRENCE\ComfyUI_windows_portable\ComfyUI\output\ComfyUI_00001_.png", "destinationPath": "c:/your/project/path/images/my_image.png"}
Inputs: sourcePath (required), destinationPath (required).
generate_imageA
Generate an image using ComfyUI with the provided workflow. Example: {"workflow": {"3": {"inputs": {"seed": 1234, "steps": 20, "cfg": 8, "sampler_name": "euler", "scheduler": "normal", "denoise": 1, "model": ["4", 0], "positive": ["6", 0], "negative": ["7", 0], "latent_image": ["5", 0]}, "class_type": "KSampler"}, "4": {"inputs": {"ckpt_name": "v1-5-pruned-emaonly-fp16.safetensors"}, "class_type": "CheckpointLoaderSimple"}, "5": {"inputs": {"width": 512, "height": 512, "batch_size": 1}, "class_type": "EmptyLatentImage"}, "6": {"inputs": {"text": "your prompt here", "clip": ["4", 1]}, "class_type": "CLIPTextEncode"}, "7": {"inputs": {"text": "negative prompt here", "clip": ["4", 1]}, "class_type": "CLIPTextEncode"}, "8": {"inputs": {"samples": ["3", 0], "vae": ["4", 2]}, "class_type": "VAEDecode"}, "9": {"inputs": {"filename_prefix": "ComfyUI", "images": ["8", 0]}, "class_type": "SaveImage"}}}
Inputs: workflow (required), wait.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct step in the image generation workflow: generation, status polling, and file copying. There is no overlap in purpose.
All tool names follow a clear verb_noun pattern (generate_image, check_status, copy_image) with consistent snake_case formatting.
With only 3 tools, the server is tightly focused on the essential ComfyUI workflow. Each tool serves a necessary function and the count is appropriate for the narrow scope.
The tools cover the core lifecycle of generating an image, checking its status, and copying the output. Minor gaps like cancellation or direct image retrieval exist, but they are not critical for the primary use case.
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for Wan AI video generation
Related MCP Servers
- AlicenseBqualityDmaintenanceA server that integrates ComfyUI with MCP, allowing users to generate images and download them through natural language interactions.422Apache 2.0
- AlicenseAqualityDmaintenanceMCP server for ComfyUI — text-to-image, variations, img2img refine, upscale, image proxy, and workflow runner.15145 npm3MIT
- 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