Skip to main content
The BFL MCP server lets you generate and edit images using natural language in Claude Desktop, Claude.ai, or any MCP-compatible client. It exposes the FLUX.2 generation models alongside the FLUX.1 specialist tools — Fill (inpainting) and Expand (outpainting).

FLUX.2 generation models

  • FLUX.2 [pro] — Best balance of speed, quality, and cost. Recommended default for all tasks. Up to 8 reference images.
  • FLUX.2 [max] — Highest quality output. Use for hero images and final deliverables. Up to 8 reference images.
  • FLUX.2 [flex] — Optimized for text and typography rendering. Up to 8 reference images.
  • FLUX.2 [klein] 9B — Fast and affordable with good quality. Up to 4 reference images.
  • FLUX.2 [klein] 4B — Fastest and cheapest. Great for rapid iterations. Up to 4 reference images.

FLUX.1 specialist tools

  • FLUX.1 Fill [pro] — Inpainting. Remove or replace specific areas using a mask and text prompt.
  • FLUX.1 Expand [pro] — Outpainting. Extend images beyond their original borders in any direction.

Setup Instructions

Claude Desktop

1

Get your BFL API key

Sign up at Black Forest Labs to obtain your API key.
2

Open Claude Desktop configuration

Locate your configuration file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
3

Add MCP server configuration

Add the following configuration to your claude_desktop_config.json file:
{
  "mcpServers": {
    "bfl-flux": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://flux-mcp-bfl-e21faf2e.koyeb.app/",
        "--header",
        "x-key: ${BFL_API_KEY}"
      ],
      "env": {
        "BFL_API_KEY": "your_bfl_api_key_here"
      }
    }
  }
}
Replace your_bfl_api_key_here with your actual BFL API key obtained in Step 1.
4

Restart Claude Desktop

Quit and restart Claude Desktop to load the new MCP server configuration. The FLUX tools will appear automatically in Claude’s tool list.

Claude.ai

1

Get your BFL API key

Sign up at Black Forest Labs to obtain your API key.
2

Access Custom Connectors

Navigate to Claude.ai and go to SettingsCustom Connectors.
3

Add a new connector

Configure the connector with the following details:
  • URL: https://flux-mcp-bfl-e21faf2e.koyeb.app/
  • Headers: Add a custom header
    • Name: x-key
    • Value: Your BFL API key
4

Save and start using

Save the connector configuration and start a new conversation. You can now ask Claude to generate images using FLUX models.

Usage

Once configured, ask Claude to generate or edit images in natural language:
  • “Generate an image of a sunset over mountains in soft golden hour light”
  • “Take this photo and swap the background to a beach scene” (attach an image)
  • “Fill in the missing area of this photo” (with a mask)
  • “Expand this image to make it wider”
Claude automatically selects the right model, submits the request, polls for the result, and returns the finished image.

Multi-image editing

FLUX.2 models accept multiple reference images. You can combine elements across them:
  • “Put the person from the first image in the outfit from the second image”
  • “Create a scene with the architecture from image 1 and the lighting from image 2”

Pricing

You are billed directly by Black Forest Labs based on your API usage. Each user uses their own API key. See current pricing at bfl.ai/pricing.

Troubleshooting

  1. Verify your claude_desktop_config.json is formatted correctly (valid JSON)
  2. Ensure you’ve fully restarted Claude Desktop (quit and reopen)
  3. Check that your API key is set correctly in the env section
  4. Look for error messages in Claude Desktop’s developer console
  • Verify your BFL API key is valid and active
  • Ensure the API key is correctly entered without extra spaces or quotes
  • Check that your key has sufficient credits for generation
  • Confirm you’re using the correct header name: x-key
  • The default timeout is 300 seconds (5 minutes)
  • Check the BFL API status at status.bfl.ai
  • Try again with a simpler prompt or lower resolution
  • Verify your network connection is stable
  • Use more detailed and specific prompts
  • Try FLUX.2 [flex]
  • Refer to the Prompting Guide for best practices
  • Experiment with different aspect ratios and parameters

Best Practices

  • Use specific prompts: Include details about style, lighting, composition, and subject for best results
  • Start with FLUX.2 [pro]: Best balance of quality, speed, and cost for both generation and editing
  • Iterate on results: Refine your prompt if the first generation isn’t perfect
  • Monitor usage: Track API usage through the BFL dashboard