comfyui-mcp-server

comfyui-mcp-server

61

The ComfyUI MCP Server is a Python-based server that allows AI agents to programmatically generate images via requests to a local ComfyUI instance using the MCP protocol. It supports flexible workflows and dynamic parameters for image generation.

What are the prerequisites for running the ComfyUI MCP Server?

You need Python 3.10+, a locally running ComfyUI instance, and dependencies like requests, websockets, and mcp installed via pip.

How do I start ComfyUI?

Navigate to the ComfyUI directory and run python main.py --port 8188 to start it on port 8188.

How can I customize the image generation request?

Modify the payload in client.py to change parameters such as prompt, width, height, workflow_id, or model.

Where should I place the workflow files?

Place API-format workflow files in the workflows/ directory. Export workflows from ComfyUI’s UI with 'Save (API Format)'.

What should I do if the model is not found?

Ensure the chosen model exists in the <ComfyUI_dir>/models/checkpoints/ directory.