lightweight Python-based MCP (Model Context Protocol) server for local ComfyUI
A lightweight Python-based MCP (Model Context Protocol) server that interfaces with a local ComfyUI instance to generate images programmatically via AI agent requests.
This project enables AI agents to send image generation requests to ComfyUI using the MCP protocol over WebSocket. It supports:
basic_api_test.json
).prompt
, width
, height
, and model
.localhost:8188
).requests
, websockets
, mcp
(install via pip).Clone the Repository:
git clone
Install Dependencies:
pip install requests websockets mcp
Start ComfyUI:
cd <ComfyUI_dir>
python main.py --port 8188
basic_api_test.json
) in the workflows/
directory.ws://localhost:9000
."a dog wearing sunglasses"
with 512x512
using sd_xl_base_1.0.safetensors
.Response from server:
{
"image_url": "http://localhost:8188/view?filename=ComfyUI_00001_.png&subfolder=&type=output"
}
client.py
’s payload
to change prompt
, width
, height
, workflow_id
, or model
."params": json.dumps({
"prompt": "a cat in space",
"width": 768,
"height": 768,
"workflow_id": "basic_api_test",
"model": "v1-5-pruned-emaonly.ckpt"
})
server.py
: MCP server with WebSocket transport and lifecycle support.comfyui_client.py
: Interfaces with ComfyUI’s API, handles workflow queuing.client.py
: Test client for sending MCP requests.workflows/
: Directory for API-format workflow JSON files.model
(e.g., v1-5-pruned-emaonly.ckpt
) exists in <ComfyUI_dir>/models/checkpoints/
.comfyui_client.py
’s DEFAULT_MAPPING
if needed.Feel free to submit issues or PRs to enhance flexibility (e.g., dynamic node mapping, progress streaming).
Apache License
Gitlab Kanban Mcp Server
GitLabのカンバンボード操作を行うためのMCPサーバー
Webflow Mcp Server
Webflow MCP server
Mac Shell Mcp
An MCP (Model Context Protocol) server for executing macOS terminal commands with ZSH shell. This server provides a secure way to execute shell commands with built-in whitelisting and approval mechanisms.
MCP server for accessing FRED (Federal Reserve Economic Data) API
A Cloudflare Worker that serves as an MCP (Model Context Protocol) server for code explanation. It analyzes and explains code with a comprehensive breakdown of structure and functionality.