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 ServerGenerate 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"}
| Name | Required | Description | Default |
|---|---|---|---|
| promptId | Yes | Prompt ID to check |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full responsibility for disclosing behavior. It states 'check the status' but does not indicate whether this is a read-only operation, what statuses are possible, whether it is asynchronous, or whether there are any side effects. The example only clarifies the parameter format, not the tool's behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one sentence plus a focused example. Every word earns its place. It is front-loaded with the core action and resource, and the example is directly useful for parameter format.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having only one parameter, the tool likely requires context about what the response will look like. There is no output schema, and the description does not fill that gap by explaining status values or polling implications. The sibling tools suggest an async workflow, but the description does not address this.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides a clear description for the single parameter 'promptId', and the example adds concrete format context (a UUID-like structure). This goes beyond the schema and helps the agent understand the expected input.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: checking the status of a prompt. It uses a specific verb ('check') and resource ('status of a prompt'), and the sibling tools (generate_image, copy_image) make the distinction evident. It lacks an explicit contrast with siblings, but the purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives. The description does not mention that it should be used after submitting a prompt or as a polling mechanism, nor does it explain why it would be preferred over generate_image or copy_image. The usage context is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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"}
| Name | Required | Description | Default |
|---|---|---|---|
| sourcePath | Yes | Path to the source image in ComfyUI output | |
| destinationPath | Yes | Path where the image should be copied to |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It clearly states it performs a copy operation, but it does not disclose potential edge cases such as overwriting existing files, creating missing directories, or error handling. For a simple copy operation this is adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence followed by a concrete example. It is front-loaded with the core purpose and every piece of text earns its place. There is no unnecessary verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, the description is largely complete: it states the source, destination, and operation. However, it could benefit from noting behavior like overwriting or directory creation, which would make it fully comprehensive for a file operation with no annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the parameters are already well-documented. The description adds an example with concrete paths, which reinforces the expected format but does not introduce new semantic information beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (copy), the resource (image), the source (ComfyUI output), and the destination (a project location). This specific verb+resource+scope distinguishes it from sibling tools like generate_image and check_status, which have different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool: copying generated images from ComfyUI output to a project directory. However, it does not explicitly state when not to use it or mention alternatives, though the sibling tools make the workflow context obvious.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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"}}}
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Whether to wait for the image generation to complete | |
| workflow | Yes | ComfyUI workflow JSON object |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to mention side effects, output format, or whether the tool blocks until completion. The 'wait' parameter exists in the schema but is not described in the tool description, leaving behavioral expectations vague.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with a clear one-sentence purpose, followed by a necessary but lengthy JSON example. While the example adds length, it is directly relevant and earns its place. The structure is logical, with no wasted prose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description provides a complete workflow example and indicates the primary action, but it does not explain what happens after generation (e.g., where the image is saved, if it is returned) or any conditional behavior like the 'wait' parameter. Given no output schema and no annotations, this leaves gaps in the tool's overall context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds significant value by including a detailed example workflow JSON, which clarifies the structure and expected format for the 'workflow' parameter. This goes beyond the schema's simple 'ComfyUI workflow JSON object' description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Generate an image using ComfyUI with the provided workflow.' This is a specific verb+resource that distinguishes it from siblings like check_status and copy_image, which have entirely different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage (generate an image when you have a workflow) but does not explicitly state when to use this tool versus alternatives, nor does it mention exclusions or prerequisites. With siblings like check_status and copy_image, the intended use is clear by contrast, but no direct guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
check_status - First observed
copy_image - First observed
generate_image
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.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
MCP server for NanoBanana AI image generation and editing
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.1584 npm1MIT
- 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.-
- AlicenseAqualityDmaintenanceMCP server that provides image generation, captioning, and tagging via ComfyUI API, configurable for agent tools.43MIT