fm-mcp-comfyui-bridge
@rerofumi
LLM MCP server for image generation with ComfyUI
Overview
What is fm-mcp-comfyui-bridge?
fm-mcp-comfyui-bridge is an MCP server implementation that provides image generation, captioning, and tag parsing by accessing the ComfyUI API. It is designed for developers using AI agent tools who need to interact with a local ComfyUI instance.
How to use fm-mcp-comfyui-bridge?
Install using uv (pip install -e .), then configure the MCP client with the command uv --directory <path> run fm-mcp-comfyui-bridge. Set the ComfyUI endpoint (default http://localhost:8188), create a config.yaml for checkpoint and LoRA settings, and an ollama.yaml for vision model. Use the provided tools generate_picture, get_picture, get_caption, and get_tag via the MCP interface.
Key features of fm-mcp-comfyui-bridge
- Image generation using ComfyUI
- Caption generation for generated images
- Tag analysis (WD1.4) for generated images
- Simple setup and launch with uv
- Provides API endpoints as an MCP server
Use cases of fm-mcp-comfyui-bridge
- Generate images from text prompts via ComfyUI
- Retrieve PNG binary data of generated images
- Obtain textual captions of generated images
- Analyze generated images for WD1.4 tags
FAQ from fm-mcp-comfyui-bridge
What are the system requirements?
Python 3.13+, a locally running ComfyUI (default http://localhost:8188), the uv package manager, and a locally running ollama with a vision model for captioning.
How do I install and set up the server?
Clone the repository, run uv pip install -e ., then configure your MCP client with the command uv --directory <path> run fm-mcp-comfyui-bridge. Optionally copy the sample config file and edit config.yaml for your model and LoRA settings.
What tools does the server provide?
Four tools: generate_picture (generate image from prompt), get_picture (get PNG binary), get_caption (get text caption), and get_tag (get WD1.4 tags). API resources include info://about, help://tools, and docs://{topic}.
How do I use a custom workflow?
Place an API-format workflow JSON in src/fm_mcp_comfyui_bridge/config/workflow/ and create a custom.yaml in the config directory. If custom.yaml exists, the custom workflow runs; otherwise the default workflow is used.
Where does the WD1.4 tag model come from?
The tag analysis part uses source code and model data from SmilingWolf’s wd-tagger. The model data is downloaded on first execution.