- Home
- MCP servers
- Comfy
Comfy
- python
37
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run a Comfy-based MCP server that delegates image generation to a remote Comfy server via a FastMCP workflow. This server lets you submit prompts, monitor processing, and retrieve final images through a stable MCP interface.
How to use
You will connect an MCP client to the Comfy MCP Server to generate images from prompts. Start the server with the MCP command and environment variables in place, then use your MCP client to request images by topic or prompt. The server handles submitting prompts to the remote Comfy server, waiting for completion, and returning the resulting image in the configured output format.
How to install
Prerequisites you need before installation:
Install the MCP command-line interface for hosting your MCP servers.
Set up the required environment variables for your Comfy workflow, then run the MCP server.
uvx mcp[cli]
export COMFY_URL=http://your-comfy-server-url:port
export COMFY_WORKFLOW_JSON_FILE=/path/to/the/comfyui_workflow_export.json
export PROMPT_NODE_ID=6
export OUTPUT_NODE_ID=9
export OUTPUT_MODE=file
# Optional for prompt generation via Ollama
export OLLAMA_API_BASE=http://localhost:11434
export PROMPT_LLM=your-model-name
uvx comfy-mcp-server
# Example cluster config to run from Claude Desktop Config (per MCP setup)
# This snippet shows how to plan a client config; actual runtime uses the server start above.
Configuration
Configure the server by providing the following environment variables:
export COMFY_URL=http://your-comfy-server-url:port
export COMFY_WORKFLOW_JSON_FILE=/path/to/the/comfyui_workflow_export.json
export PROMPT_NODE_ID=6
export OUTPUT_NODE_ID=9
export OUTPUT_MODE=file
# Optional for prompt generation via Ollama
export OLLAMA_API_BASE=http://localhost:11434
export PROMPT_LLM=your-model-name
Examples
Example MCP server configuration to run locally via a Claude Desktop Config.
{
"mcpServers": {
"Comfy MCP Server": {
"command": "/path/to/uvx",
"args": [
"comfy-mcp-server"
],
"env": {
"COMFY_URL": "http://your-comfy-server-url:port",
"COMFY_WORKFLOW_JSON_FILE": "/path/to/the/comfyui_workflow_export.json",
"PROMPT_NODE_ID": "6",
"OUTPUT_NODE_ID": "9",
"OUTPUT_MODE": "file"
}
}
}
}
Notes
The server is capable of connecting to a remote Ollama instance for prompt generation if you have it running. Ensure the API base URL and the selected model name are correctly configured in your environment.
Available tools
generate_image
Generates an image from a prompt by validating env vars, loading the prompt template, submitting to the remote Comfy server, polling for status, and returning the final image.
generate_prompt
Creates a comprehensive image generation prompt from a given topic using a simple LLM prompt chain.