Skip to main content
Glama

FLUX Image Generator MCP Server

by frankdeno

FLUX Image Generator MCP Server

An MCP (Model Context Protocol) server for generating images using Black Forest Lab's FLUX model. Uses the latest MCP SDK (v1.7.0).

Features

  • Generate images based on text prompts
  • Customize image dimensions, prompt upsampling, and safety settings
  • Save generated images locally
  • Batch image generation from multiple prompts

Prerequisites

  • Node.js (v18.0.0 or higher)
  • Black Forest Lab API key (get one at https://api.bfl.ml)

Installation

From Source

  1. Clone this repository
  2. Install dependencies:
npm install
  1. Create a .env file based on .env.example and add your Black Forest Lab API key:
BFL_API_KEY=your_api_key_here
  1. Build the project:
npm run build

Using npm

npm install -g @modelcontextprotocol/server-flux-image-generator

Usage

Starting the MCP Server

Start the server with:

npm start

For development with auto-recompilation:

npm run watch

Integrating with MCP Clients

To use this server with MCP clients (like Claude), add the following to your client's configuration:

{ "mcpServers": { "flux-image-generator": { "command": "mcp-server-flux-image-generator", "env": { "BFL_API_KEY": "your_api_key_here" } } } }

Available Tools

generateImage

Generates an image based on a text prompt with customizable settings.

Parameters:

  • prompt (string, required): Text description of the image to generate
  • width (number, optional, default: 1024): Width of the image in pixels
  • height (number, optional, default: 1024): Height of the image in pixels
  • promptUpsampling (boolean, optional, default: false): Enhance detail by upsampling the prompt
  • seed (number, optional): Random seed for reproducible results
  • safetyTolerance (number, optional, default: 3): Content moderation tolerance (1-5)

Example:

{ "prompt": "A serene lake at sunset with mountains in the background", "width": 1024, "height": 768, "promptUpsampling": true, "seed": 12345, "safetyTolerance": 3 }

quickImage

A simplified tool for quickly generating images with default settings.

Parameters:

  • prompt (string, required): Text description of the image to generate

Example:

{ "prompt": "A futuristic cityscape with flying cars" }

batchGenerateImages

Generates multiple images from a list of prompts.

Parameters:

  • prompts (array of strings, required): List of text prompts (maximum 10)
  • width (number, optional, default: 1024): Width of the images
  • height (number, optional, default: 1024): Height of the images

Example:

{ "prompts": [ "A serene lake at sunset", "A futuristic cityscape", "A magical forest with glowing plants" ], "width": 1024, "height": 768 }

Output Format

All tools return responses in this format:

{ "image_url": "https://storage.example.com/generated_image.jpg", "local_path": "/path/to/output/flux_1234567890.png" }

For errors:

{ "error": true, "message": "Error description" }

The batch tool returns:

{ "total": 3, "successful": 2, "failed": 1, "results": [ { "prompt": "A serene lake at sunset", "success": true, "image_url": "https://storage.example.com/image1.jpg", "local_path": "/path/to/output/flux_batch_1234567890_0.png" }, { "prompt": "A futuristic cityscape", "success": true, "image_url": "https://storage.example.com/image2.jpg", "local_path": "/path/to/output/flux_batch_1234567890_1.png" }, { "prompt": "Prohibited content", "success": false, "error": "Content policy violation" } ] }

License

MIT

Deploy Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

MCP 服务器使用 Black Forest Lab 的 FLUX 模型根据文本提示生成图像,允许自定义图像尺寸、提示上采样、安全设置和批量生成。

  1. 特征
    1. 先决条件
      1. 安装
        1. 来自源
        2. 使用 npm
      2. 用法
        1. 启动 MCP 服务器
        2. 与 MCP 客户端集成
      3. 可用工具
        1. 生成图像
        2. 快速图像
        3. 批量生成图像
      4. 输出格式
        1. 执照

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A MCP server that enables Claude and other MCP-compatible assistants to generate images from text prompts using Together AI's image generation models.
            Last updated -
            1
            4
            MIT License
            • Apple
            • Linux
          • A
            security
            F
            license
            A
            quality
            A TypeScript-based MCP server that generates images using OpenAI's dall-e-3 model based on text prompts and saves them to a specified directory.
            Last updated -
            1
            10
            • Apple
          • A
            security
            A
            license
            A
            quality
            An MCP server that enables AI assistants to generate images using Black Forest Labs' Flux model via Cloudflare Workers.
            Last updated -
            1
            MIT License
          • A
            security
            F
            license
            A
            quality
            An MCP image generation server based on the Flux Schnell model that provides API access for generating images from text prompts with customizable dimensions and seeds.
            Last updated -
            1
            1
            • Linux
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/frankdeno/flux-image-generator-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server