bfl-flux-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bfl-flux-mcpGenerate an image of a sunset over the ocean"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BFL Flux MCP Server
Minimal Python MCP server for Black Forest Labs Flux image generation API.
Features
Seven comprehensive tools:
generate_image- Text-to-image with model selectionedit_image- Image editing with natural languageexpand_image- Directional outpainting (add pixels to any side)create_variation- Create variations of an image using Redux (image_prompt)save_image- Download and save images before URLs expirecheck_credits- Verify API key and credit balancelist_finetunes- View your custom finetuned models
All Flux models supported:
Generation:
flux-pro-1.1(default),flux-pro-1.1-ultra,flux-2-pro,flux-2-flex,flux-2-max,flux-pro,flux-devEditing:
kontext-pro,kontext-max,fill-proExpansion:
expand-pro
Full API parameter support:
Aspect ratio or custom dimensions
Prompt upsampling for enhanced output
Output format (PNG/JPEG)
Safety tolerance levels
Model-specific: guidance, steps, raw mode
Related MCP server: FLUX Image Generator MCP Server
Installation
# With uv (recommended)
uv sync
# With pip
pip install -e .Configuration
Get your API key at api.bfl.ml
export BFL_API_KEY="your-api-key-here"Claude Code / MCP Config
Add to .mcp.json:
{
"mcpServers": {
"bfl-flux": {
"command": "uv",
"args": ["run", "--project", "/path/to/bfl-flux-mcp", "bfl-flux-mcp"],
"env": {
"BFL_API_KEY": "${BFL_API_KEY}"
}
}
}
}Or with uvx (once published):
{
"mcpServers": {
"bfl-flux": {
"command": "uvx",
"args": ["bfl-flux-mcp"],
"env": {
"BFL_API_KEY": "${BFL_API_KEY}"
}
}
}
}Usage
Check Credits
Verify your API key is working and check balance:
Check my BFL creditsGenerate Image
Generate an image of a mountain landscape at sunset, photorealistic styleParameters:
Parameter | Description | Default |
| Text description (required) | - |
| Model to use |
|
|
|
|
| Custom dimensions (multiple of 16, max 2048) | - |
| For reproducibility | - |
| 0 (strict) to 6 (permissive) | 2 |
| Enhance prompt for richer output |
|
|
|
|
| Prompt adherence 1.5-10 (flux-2-flex only) | - |
| Generation steps 1-50 (flux-2-flex only) | - |
| Raw mode (flux-pro-1.1-ultra only) |
|
Edit Image
Edit this image to add a rainbow in the skyParameters:
Parameter | Description | Default |
| Edit instructions (required) | - |
| Base64-encoded image or URL (required) | - |
|
|
|
| Output aspect ratio | preserve |
| For reproducibility | - |
| 0-2 | 2 |
Expand Image
Expand an image by adding pixels to any side (outpainting):
Expand the image by 256 pixels on the right sideParameters:
Parameter | Description | Default |
| Image to expand: path, URL, or base64 (required) | - |
| Optional guidance for the expansion | - |
| Pixels to add to top (0-2048) | 0 |
| Pixels to add to bottom (0-2048) | 0 |
| Pixels to add to left (0-2048) | 0 |
| Pixels to add to right (0-2048) | 0 |
| For reproducibility | - |
| 0-6 | 2 |
|
|
|
Save Image
Download and save a generated image before the URL expires (10 min):
Save that image to /path/to/logo.pngParameters:
Parameter | Description | Default |
| Image URL from generate/edit result (required) | - |
| Destination file path (required) | - |
List Finetunes
View your custom finetuned models:
Show my finetuned modelsNo parameters required.
Create Variation
Create variations of an existing image that maintain its essence while applying optional text guidance:
Create a variation of this image with a warmer color paletteParameters:
Parameter | Description | Default |
| Source image: path, URL, or base64 (required) | - |
| Optional text guidance for the variation | - |
|
|
|
| Output aspect ratio |
|
| For reproducibility | - |
| 0-6 | 2 |
|
|
|
Pricing
Model | Credits | USD |
flux-pro-1.1 | 4 | $0.04 |
flux-pro-1.1-ultra | 6 | $0.06 |
flux-2-pro | 5 | $0.05 |
flux-2-flex | 1-5 | $0.01-0.05 |
flux-2-max | 6 | $0.06 |
kontext-pro | 4 | $0.04 |
kontext-max | 8 | $0.08 |
expand-pro | 4 | $0.04 |
1 credit = $0.01 USD
Note: Credits used are shown in tool responses when available.
Development
# Install with dev dependencies
uv sync --extra dev
# Run linter
uv run ruff check .
# Format code
uv run ruff format .
# Run tests
uv run pytest -v
# Run tests with coverage
uv run pytest --cov=bfl_flux_mcp --cov-report=term-missingLicense
MIT - see LICENSE
Links
This server cannot be deployed
Maintenance
Related MCP Connectors
Official FLUX MCP server. Generate, edit, vary, and browse images from Black Forest Labs.
MCP server for Flux AI image generation
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server for Pixapi: check live credit pricing and balance, then generate images and video.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceImplements a Model Context Protocol (MCP) server powered by Flux API from Cephalon Cloud, enabling users to utilize advanced AI capabilities through standardized communication.31MIT
- FlicenseCqualityDmaintenanceAn MCP server that generates images based on text prompts using Black Forest Lab's FLUX model, allowing for customized image dimensions, prompt upsampling, safety settings, and batch generation.31-
- AlicenseNot gradedqualityDmaintenanceA simple MCP server for generating images using Flux models via the Replicate API.33 npmMIT
- FlicenseNot gradedqualityCmaintenanceMCP server for local image generation using FLUX.2 via Hugging Face diffusers, designed to run on a Windows GPU and be called remotely by Claude Cowork over Tailscale.-