comfyui-mcp-server
by joenorton·★ 313·Score 50
Lightweight Python MCP server for local ComfyUI that enables AI agents to generate and iteratively refine images, audio, and video.
Overview
ComfyUI MCP Server provides a bridge between AI agents and local ComfyUI installations, enabling natural language control over media generation. The server exposes various tools including image generation, asset management, job control, and workflow execution. It supports iterative refinement through its regenerate functionality and provides asset identity for reliable follow-up operations. The architecture uses a streamable HTTP transport and supports both simple single-shot generation and complex stateful control loops for more advanced use cases.
Try asking AI
After installing, here are 8 things you can ask your AI assistant:
When to choose this
Choose when working with ComfyUI and want AI agents to generate/refine media assets through natural conversation.
When NOT to choose this
Don't choose if you need cloud-based AI generation, want to avoid local setup complexity, or require multi-user collaboration features.
Tools this server exposes
12 tools extracted from the READMEgenerate_imageGenerate images from text prompts
generate_songGenerate audio from tags and lyrics
regenerateRegenerate an existing asset with parameter overrides
view_imageView generated images inline in the conversation
get_jobPoll job completion status by prompt_id
list_assetsBrowse recently generated assets
get_asset_metadataGet provenance and parameters for an asset
cancel_jobCancel a queued or running job
list_modelsList available ComfyUI models
set_defaultsSet default values for generation parameters
list_workflowsList all available ComfyUI workflows
publish_assetPublish a generated asset to the web directory
Comparable tools
Installation
Quick Installation
1) Clone and install dependencies:
git clone https://github.com/joenorton/comfyui-mcp-server.git
cd comfyui-mcp-server
pip install -r requirements.txt2) Start ComfyUI locally:
cd <ComfyUI_dir>
python main.py --port 81883) Run the MCP server:
python server.py4) Configure your AI client (e.g., Claude Desktop, Cursor) with:
{
"mcpServers": {
"comfyui-mcp-server": {
"type": "streamable-http",
"url": "http://127.0.0.1:9000/mcp"
}
}
}FAQ
- What is the difference between generate_image and regenerate?
- generate_image creates a new image from a prompt, while regenerate recreates an existing asset with optional parameter overrides without requiring a new prompt.
- Can I use custom ComfyUI workflows with this server?
- Yes, place JSON workflow files in the workflows/ directory with PARAM_* placeholders to expose parameters as MCP tools.
- How are assets identified and referenced?
- Assets are identified by (filename, subfolder, type) tuples instead of URLs for robustness across hostname changes.
Compare comfyui-mcp-server with
Last updated · Auto-generated from public README + GitHub signals.