by joenorton
lightweight Python-based MCP (Model Context Protocol) server for local ComfyUI
# Add to your Claude Code skills
git clone https://github.com/joenorton/comfyui-mcp-serverGenerate and refine AI images/audio/video through natural conversation
A lightweight MCP (Model Context Protocol) server that lets AI agents generate and iteratively refine images, audio, and video using a local ComfyUI instance.
You run the server, connect a client, and issue tool calls. Everything else is optional depth.
This proves everything is working.
git clone https://github.com/joenorton/comfyui-mcp-server.git
cd comfyui-mcp-server
pip install -r requirements.txt
Make sure ComfyUI is installed and running locally.
cd <ComfyUI_dir>
python main.py --port 8188
From the repository directory:
python server.py
The server listens at:
http://127.0.0.1:9000/mcp
Run the included test client:
# Use default prompt
python test_client.py
# Or provide your own prompt
python test_client.py -p "a beautiful sunset over mountains"
python test_client.py --prompt "a cat on a mat"
test_client.py will:
generate_image with your prompt (or a default)No comments yet. Be the first to share your thoughts!
If this step succeeds, the system is working.
Note: The test client respects server defaults configured via config files, environment variables, or set_defaults calls. Only the prompt parameter is required; all other parameters use server defaults automatically.
That’s it.
Once the server is running, you can connect it to an AI client.
Create a project-scoped .mcp.json file:
{
"mcpServers": {
"comfyui-mcp-server": {
"type": "streamable-http",
"url": "http://127.0.0.1:9000/mcp"
}
}
}
Note: Some clients use "type": "http" instead of "streamable-http". Both work with this server. If auto-discovery doesn't work, try changing the type field.
Restart your AI client. You can now call tools such as:
generate_imageview_imageregenerateget_joblist_assetsThis is the primary intended usage mode.
Once you’ve confirmed the server runs and a client can connect, the system supports:
regenerate (no re-prompting)view_image)Everything below builds on the same basic loop you just tested.
If you’ve used earlier versions of this proje...