flux-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Host for the MCP server | 0.0.0.0 |
| MCP_PORT | No | Port for the MCP server (the image sets MCP_PORT=8300) | 3000 |
| FLUX_MAX_SIDE | No | Limit: maximum image side in px (default see config.py) | |
| FLUX_MIN_SIDE | No | Limit: minimum image side in px (default see config.py) | |
| FLUX_MAX_COUNT | No | Limit: maximum number of images per call (default see config.py) | |
| FLUX_MCP_TOKEN | Yes | Bearer token; required for HTTP unless --no-auth | |
| FLUX_TIMEOUT_S | No | Limit: timeout in seconds per call, default 300 (see config.py) | |
| FLUX_OUTPUT_DIR | No | Directory for stored images | data/images |
| FLUX_COMFYUI_URL | No | ComfyUI server URL (compose sets http://comfyui:8188) | http://localhost:8188 |
| FLUX_IDLE_UNLOAD_S | No | Unload ComfyUI's models after this many idle seconds, freeing memory for other GPU users such as vLLM (0 = never). The next call then reloads them (~25 s from page cache, or minutes after a ComfyUI restart) | 600 |
| FLUX_WORKFLOWS_DIR | No | Directory containing the ComfyUI workflow JSON files and nodes.yaml | workflows |
| FLUX_MAX_INPUT_BYTES | No | Limit: maximum size of uploaded input images in bytes, default 20 MB (see config.py) | |
| FLUX_PUBLIC_BASE_URL | No | Base of the image URLs returned to clients | http://localhost:8300 |
| FLUX_MAX_PROMPT_CHARS | No | Limit: maximum prompt length in characters (default see config.py) | |
| FLUX_PREVIEW_MAX_SIDE | No | Limit: maximum side of the returned JPEG preview in px, default 1024 (see config.py) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| edit_imageA | Edit an image, or combine several reference images, with FLUX 3 Image Klein With one image, describe the change ("make the sky stormy", "add a red scarf to the dog"). With several, say what to take from each by order ("the woman from the first image standing in the forest from the second image"). Returns a JPEG preview of each result plus the URL and id of the full-resolution PNG. |
| generate_imageA | Generate images from a text description with FLUX 3 Image Klein Returns a JPEG preview of each image plus the URL and id of the full-resolution PNG. Use the id with edit_image to refine a result. |
| get_imageA | Show a stored image again, with how it was made Returns the preview, URL and stored details (prompt, seed, upsampled caption, model). Without an id it returns the most recent image, which also recovers the result of a call that timed out on the client side. |
| list_modelsA | List the workflows this server runs and the model files ComfyUI can see |
| remove_backgroundA | Cut out the main subject and make the background transparent (BiRefNet) Returns a transparent PNG (the preview shows it on white) plus its URL and id. |
| server_statusA | Report whether ComfyUI is up, its queue, free memory and whether models are loaded |
| unload_modelsA | Free the GPU memory held by the image models now The models reload automatically on the next request, which then takes longer. The server also does this by itself after a period without requests. |
| upscale_imageA | Enlarge an image 2x or 4x with an upscaling model (Real-ESRGAN) Adds sharpness rather than new content; use it for prints and wallpapers. Takes a few seconds. Returns a preview plus the URL and id of the full-resolution PNG. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool targets a clearly distinct action on the image pipeline: generate, edit, upscale, background removal, retrieve, plus model/server administration. The descriptions explicitly delineate the boundaries (e.g. upscale 'adds sharpness rather than new content', edit requires an id from generate), so an agent can select correctly without guessing.
Seven of eight tools follow a clean verb_noun snake_case pattern (generate_image, edit_image, upscale_image, remove_background, get_image, list_models, unload_models). The only deviation is 'server_status', which is noun-first, but it remains readable and unambiguous.
Eight tools is well within the ideal 3-15 range and every tool earns its place: four core image operations, one retrieval tool, and three operational/admin tools. Nothing looks redundant or like padding.
The core lifecycle (generate → edit → upscale → cutout → retrieve) is fully covered, along with model listing and GPU management. Minor gaps remain: there is no way to enumerate stored images (only fetch by id or 'most recent') and no delete/cleanup operation, but agents can work around these using returned ids.