Skip to main content
Glama
frankdeno

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

Related MCP server: Flux Schnell Server

Prerequisites

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

Available Tools

3 tools
batchGenerateImagesC

Generate multiple images from a list of prompts

ParametersJSON Schema
NameRequiredDescriptionDefault
promptsYesList of text prompts
widthNoWidth of the images
heightNoHeight of the images
customPathNoCustom path to save the generated images

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It doesn't describe what happens during generation (e.g., processing order, error handling), output format, rate limits, authentication needs, or whether it's a read/write operation. The description merely states what the tool does without revealing how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence with zero wasted words. It's front-loaded with the core functionality and appropriately sized for the tool's complexity. Every word earns its place in communicating the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a batch generation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address critical context like what the tool returns (image URLs, file paths, error information), how multiple prompts are processed, or any behavioral characteristics. The agent would need to guess about important operational aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain prompt formatting expectations, width/height constraints, or customPath usage scenarios. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('generate multiple images') and the resource ('from a list of prompts'), making the purpose immediately understandable. It distinguishes from 'generateImage' by specifying 'multiple' images, but doesn't explicitly differentiate from 'quickImage' which might imply a similar batch capability.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling tools 'generateImage' or 'quickImage'. There's no mention of use cases, prerequisites, performance considerations, or alternative selection criteria, leaving the agent with insufficient context for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generateImageC

Generate an image using Black Forest Lab's FLUX model based on a text prompt

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesText description of the image to generate
widthNoWidth of the image in pixels
heightNoHeight of the image in pixels
promptUpsamplingNoEnhance detail by upsampling the prompt
seedNoRandom seed for reproducible results
safetyToleranceNoContent moderation tolerance (1-5)
customPathNoCustom path to save the generated image

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the model (FLUX) but fails to describe key traits like rate limits, authentication needs, output format (e.g., image file type), error handling, or performance characteristics. This leaves significant gaps for a tool that likely involves external API calls and resource-intensive operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of an image generation tool with 7 parameters, no annotations, and no output schema, the description is incomplete. It lacks information on behavioral aspects, usage guidelines, and output details (e.g., how the image is returned), which are crucial for proper tool invocation in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning all parameters are documented in the schema. The description does not add any additional meaning or context beyond what the schema provides (e.g., it doesn't explain prompt best practices or safety tolerance implications). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Generate an image') and specifies the resource (using Black Forest Lab's FLUX model based on a text prompt), which is specific and unambiguous. However, it does not explicitly differentiate from sibling tools like 'batchGenerateImages' or 'quickImage', which might offer batch processing or faster generation, so it misses full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'batchGenerateImages' or 'quickImage'. It lacks context about scenarios, prerequisites, or exclusions, leaving the agent without explicit usage instructions beyond the basic function.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

quickImageC

Quickly generate an image based on a text prompt with default settings

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesText description of the image to generate
customPathNoCustom path to save the generated image

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'quickly' and 'default settings,' hinting at speed and simplicity, but lacks details on permissions, rate limits, output format (e.g., image type, size), or whether it's a read-only or mutating operation. This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a mutation-like tool (image generation), the description is incomplete. It lacks details on behavioral traits, output handling, and differentiation from siblings. While concise, it doesn't provide enough context for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('prompt' and 'customPath'). The description adds no additional meaning beyond implying 'default settings' might affect generation, but it doesn't clarify parameter interactions or usage. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'generate an image based on a text prompt with default settings.' It specifies the verb ('generate') and resource ('image'), though it doesn't explicitly differentiate from sibling tools like 'generateImage' or 'batchGenerateImages' beyond mentioning 'default settings.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings. It mentions 'default settings,' which might imply a simpler or faster alternative, but it doesn't specify contexts, exclusions, or named alternatives like 'batchGenerateImages' for batch processing or 'generateImage' for more control.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

C2.8/5.0
Disambiguation2/5

The tools have significant overlap in purpose, with all three focused on generating images from text prompts. 'generateImage' and 'quickImage' are particularly ambiguous—both generate a single image based on a prompt, differing only in default settings versus customizable ones. 'batchGenerateImages' is more distinct as it handles multiple prompts, but the overall set lacks clear boundaries.

Naming Consistency3/5

The naming is mixed in style: 'batchGenerateImages' uses camelCase, while 'generateImage' and 'quickImage' are more descriptive but follow a similar verbNoun pattern. There's no consistent casing convention, and the verbs ('batchGenerate', 'generate', 'quick') vary without a clear pattern, making it readable but not predictable.

Tool Count3/5

With only 3 tools, the count feels thin for an image generation server, as it lacks operations for managing or editing images. However, it covers basic generation tasks, so it's borderline—adequate for minimal functionality but could benefit from more comprehensive coverage.

Completeness2/5

The server is severely incomplete for an image generation domain. It only offers generation tools with no ability to retrieve, update, delete, or edit images. There are no tools for managing image metadata, applying filters, or handling errors, which are common in such systems, leading to significant gaps in agent workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

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