flux2-mcp-server

jankutschera/flux2-mcp-server

3.1

If you are the rightful owner of flux2-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Flux2 MCP Server is a Model Context Protocol server that allows Claude and other MCP clients to generate images using the advanced FLUX.2 models from Black Forest Labs.

Tools
6
Resources
0
Prompts
0

Flux2 MCP Server

An MCP (Model Context Protocol) server that enables Claude and other MCP clients to generate images using fal.ai's FLUX.2 models - the latest generation of image generation from Black Forest Labs.

Features

  • FLUX.2 [pro] - Studio-grade, production-optimized images
  • FLUX.2 [dev] - Development version with full parameter control
  • FLUX.2 [flex] - Flexible generation with prompt expansion
  • FLUX.2 [schnell] - Ultra-fast generation (4 steps)
  • Image Editing - Edit existing images with text instructions

Installation

Quick Install (Recommended)

# Add to Claude Code
claude mcp add flux2 --env "FAL_KEY=your-fal-api-key" -- npx -y flux2-mcp-server

Manual Installation

npm install -g flux2-mcp-server

Or run directly with npx:

FAL_KEY=your-api-key npx flux2-mcp-server

Setup

1. Get your fal.ai API Key

  1. Sign up at fal.ai
  2. Go to your dashboard
  3. Generate an API key

2. Configure Claude Desktop

Add to your Claude Desktop config:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "flux2": {
      "command": "npx",
      "args": ["-y", "flux2-mcp-server"],
      "env": {
        "FAL_KEY": "your-fal-api-key"
      }
    }
  }
}

3. Restart Claude Desktop

Available Tools

generate_image_flux2_pro

Generate studio-grade images with FLUX.2 [pro].

"Generate a photorealistic portrait of a woman in a futuristic city"

Parameters:

  • prompt (required): Image description
  • image_size: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9
  • seed: For reproducible results
  • output_format: jpeg or png
  • safety_tolerance: 1-5 (1=strict, 5=permissive)

generate_image_flux2_dev

Development model with full control over inference parameters.

Additional Parameters:

  • num_inference_steps: 1-50 (default: 28)
  • guidance_scale: 1-20 (default: 3.5)

generate_image_flux2_flex

Flexible model with automatic prompt expansion.

Additional Parameters:

  • enable_prompt_expansion: Auto-expand prompts (default: true)
  • num_inference_steps: 2-50 (default: 28)
  • guidance_scale: 1.5-10 (default: 3.5)

generate_image_flux2_schnell

Ultra-fast generation for rapid prototyping.

Parameters:

  • num_inference_steps: 1-12 (default: 4)

edit_image_flux2

Edit existing images with text instructions.

"Add sunglasses to the person in this image"

Parameters:

  • prompt (required): Editing instructions
  • image_url (required): URL of image to edit

list_flux2_models

List all available FLUX.2 models with pricing info.

Usage Examples

In Claude, you can say:

  • "Generate a cyberpunk cityscape at sunset using Flux 2 Pro"
  • "Create a quick sketch of a cat using the schnell model"
  • "Edit this image and add a rainbow in the background"
  • "What Flux 2 models are available?"

Pricing (fal.ai)

ModelPrice
FLUX.2 [pro]$0.03/MP (first), $0.015/MP (additional)
FLUX.2 [dev]~$0.025/image
FLUX.2 [flex]$0.06/MP
FLUX.2 [schnell]~$0.003/image

MP = Megapixel

Development

# Clone and install
git clone https://github.com/yourusername/flux2-mcp-server.git
cd flux2-mcp-server
npm install

# Build
npm run build

# Run in development
FAL_KEY=your-key npm run dev

Environment Variables

VariableRequiredDescription
FAL_KEYYesYour fal.ai API key

License

MIT

Links