FLUX integrates with AI agents through two complementary channels:Documentation Index
Fetch the complete documentation index at: https://docs.bfl.ml/llms.txt
Use this file to discover all available pages before exploring further.
- MCP (Model Context Protocol) lets Claude Desktop, Claude.ai, or any MCP-compatible app generate and edit images directly with FLUX.
- Agent Skills teach AI coding assistants (Claude Code, Cursor, Windsurf, β¦) how to prompt FLUX effectively and integrate the API correctly.
| MCP | Agent Skills | |
|---|---|---|
| What it does | Lets your agent generate images directly | Teaches your agent FLUX knowledge |
| Use case | Generating images in conversation | Writing code that uses FLUX |
| Install on | Claude Desktop / Claude.ai | Any agent system (Claude Code, Cursor, Windsurf, β¦) |
MCP Integration
The FLUX MCP server provides access to all FLUX models through the Model Context Protocol. Generate and edit images using natural language in Claude.Available models
- FLUX.2 [pro] β Best balance of quality, speed, and cost. Recommended default for all tasks. Supports text-to-image and image-to-image with 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.
Setup Instructions
Claude Code
Claude Desktop & Claude.ai
In Claude Desktop or on Claude.ai, go to Settings β Developer Settings β Edit Config to openclaude_desktop_config.json, then add the BFL MCP server under Local MCP Servers.
Usage
Once connected, ask Claude to generate or edit images in natural language. You can specify which model to use, or let Claude pick one based on your prompt.- Generate
- Edit
- Design
Describe what you want β portraits, illustrations, product shots, wildlife, and more.





Pricing
Usage is billed to the BFL organization you selected during the OAuth sign-in. See current pricing at bfl.ai/pricing.Troubleshooting
Tools not appearing in Claude Desktop
Tools not appearing in Claude Desktop
- Verify your
claude_desktop_config.jsonis formatted correctly (valid JSON) - Ensure youβve fully restarted Claude Desktop (quit and reopen)
- Check that the OAuth sign-in completed successfully in your browser
- Look for error messages in Claude Desktopβs developer console
Authentication errors
Authentication errors
- Make sure you have a BFL account at bfl.ai
- Try disconnecting and reconnecting the MCP server to redo the OAuth flow
- Check that your account has sufficient credits for generation
- If the browser sign-in window did not appear, ensure pop-ups are not blocked
Generation timeouts
Generation timeouts
- 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
Image quality issues
Image quality issues
- 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
Switching organizations
Switching organizations
To bill a different organization, disconnect the BFL MCP server from your client and reconnect it. The OAuth flow will prompt you to select an organization again.
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
Agent Skills
Skills are reusable capabilities for AI agents. Install them with a single command to enhance your agent with access to procedural knowledge β in this case, everything about FLUX prompting and API integration. When you install BFL Skills, your AI coding assistant (Claude Code, Cursor, Windsurf, or any compatible tool) gains expert-level knowledge of FLUX. It knows how to write effective prompts, which model to use for each task, and how to integrate the API properly.Installation
- Claude Code
- Cursor
- Other Tools
What Your Agent Learns
flux-best-practices
Prompting knowledge for all FLUX models:- Prompt structure β The formula that works:
[Subject] + [Action] + [Style] + [Context] + [Lighting] + [Technical] - No negative prompts β FLUX doesnβt support them. Describe what you want, not what you donβt.
- Lighting vocabulary β Golden hour, softbox, rim light, Rembrandt, volumetric fog, and more
- Hex colors β Precise color control with
#RRGGBBformat - Typography β How to render text in images using quoted strings
- Model selection β When to use FLUX.2 [klein] vs [max] vs [pro], when to use Kontext, etc.
bfl-api
API integration patterns:- Async polling β Use the
polling_urlfrom responses, implement exponential backoff - Rate limits β 24 concurrent requests (6 for Kontext Max), how to handle 429s
- URL expiration β Download images within 10 minutes
- Regional endpoints β
api.eu.bfl.aifor GDPR,api.us.bfl.aifor US data residency - Webhooks β Production webhook setup and verification







