Flux Studio MCP server

Bridges Flux's image generation capabilities to coding environments, enabling text-to-image, image-to-image, inpainting, and structural control operations directly within IDEs through TypeScript-to-CLI command translation.
Back to servers
Setup instructions
Provider
jmanhype
Release date
Feb 20, 2025
Language
TypeScript
Stats
19 stars

MCP Flux Studio is a powerful server that integrates Flux's advanced image generation capabilities directly into AI coding assistants like Cursor and Windsurf (Codeium). This integration allows you to generate, manipulate, and control images right from your development environment without switching contexts.

Installation Options

Installing via Smithery

The easiest way to install MCP Flux Studio for Claude Desktop is through Smithery:

npx -y @smithery/cli install @jmanhype/mcp-flux-studio --client claude

Manual Installation

For a manual installation, follow these steps:

git clone https://github.com/jmanhype/mcp-flux-studio.git
cd mcp-flux-studio
npm install
npm run build

Prerequisites

Before installation, ensure you have:

  • Node.js 18 or newer
  • Python 3.12 or newer
  • A Flux API key
  • Compatible IDE (Cursor v0.45.7+ or Windsurf/Codeium Wave 3+)

Configuration

Basic configuration requires setting environment variables:

BFL_API_KEY=your_flux_api_key
FLUX_PATH=/path/to/flux/installation

IDE Integration

Setting Up with Cursor

  1. Open Cursor (v0.45.7 or later)
  2. Navigate to Settings > Features > MCP
  3. Configure the connection (supports both stdio and SSE connections)
  4. Set environment variables via wrapper scripts if needed

Once configured, Flux Studio's tools will be available to Cursor's AI assistant.

Setting Up with Windsurf/Codeium

  1. Edit ~/.codeium/windsurf/mcp_config.json
  2. Configure the process-based tool execution
  3. Set environment variables in JSON format

After configuration, you can access Flux Studio tools through Cascade's MCP toolbar.

Using MCP Flux Studio

MCP Flux Studio provides four main tools for image operations:

Generate Images from Text

Create images from text descriptions:

{
  "prompt": "A photorealistic cat",
  "model": "flux.1.1-pro",
  "aspect_ratio": "1:1",
  "output": "generated.jpg"
}

Transform Images (Image-to-Image)

Modify existing images based on prompts:

{
  "image": "input.jpg",
  "prompt": "Convert to oil painting",
  "model": "flux.1.1-pro",
  "strength": 0.85,
  "output": "output.jpg",
  "name": "oil_painting"
}

Inpaint Images

Modify specific parts of an image:

{
  "image": "input.jpg",
  "prompt": "Add flowers",
  "mask_shape": "circle",
  "position": "center",
  "output": "inpainted.jpg"
}

Control-Based Generation

Generate images with structural control:

{
  "type": "canny",
  "image": "control.jpg",
  "prompt": "A realistic photo",
  "output": "controlled.jpg"
}

Supported Features

MCP Flux Studio supports several powerful capabilities:

  • Multiple Models: Choose from various Flux models (flux.1.1-pro, flux.1-pro, flux.1-dev, flux.1.1-ultra)
  • Customizable Output: Adjust aspect ratios and dimensions of generated images
  • Advanced Controls: Utilize edge-based generation (canny), depth-aware generation, and pose-guided generation
  • Enhancement Options: Upscale and enhance image resolution

Each tool invocation in your IDE will require your approval, and you'll receive real-time feedback on the generation progress.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "flux-studio" '{"command":"npx","args":["-y","@jmanhype/mcp-flux-studio"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "flux-studio": {
            "command": "npx",
            "args": [
                "-y",
                "@jmanhype/mcp-flux-studio"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

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

2. Add this to your configuration file:

{
    "mcpServers": {
        "flux-studio": {
            "command": "npx",
            "args": [
                "-y",
                "@jmanhype/mcp-flux-studio"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later