Get the FREE Ultimate OpenClaw Setup Guide →

mcp -bfl

MCP server for image generation using Black Forest Labs' API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio fernforestgames-mcp-server-bfl npx @fernforestgames/mcp-server-bfl \
  --env BFL_API_KEY="your-api-key-here"

How to use

This MCP server provides an AI assistant-enabled interface for generating images via the Black Forest Labs FLUX models. After adding the server to your MCP configuration, the assistant can invoke image generation requests, monitor status, and retrieve the resulting image URLs. The server handles interaction with the BFL API so your AI can request renders like a sunset, a sci-fi scene, or any prompt you provide, and receive a URL where the generated image (valid for 10 minutes) can be downloaded. You can also ask the assistant to download the completed image directly once generation finishes.

How to install

Prerequisites:

  • Node.js 22+ and npm installed
  • A valid BFL API key

Installation steps:

  1. Install Node.js (v22+) from the official website or via your system package manager.
  2. Ensure npm and npx are available in your PATH by running: node -v && npm -v
  3. Obtain your BFL API key and prepare it for use with the MCP server.
  4. Create or update your MCP configuration to include the BFL server entry, e.g. (see example in README):

Code:

Example to add to your .mcp.json

{ "mcpServers": { "bfl": { "type": "stdio", "command": "npx", "args": [ "@fernforestgames/mcp-server-bfl" ], "env": { "BFL_API_KEY": "your-api-key-here" } } } }

  1. Start or reload your MCP configuration. The server will run via npx and connect to the BFL API using your API key. When prompted by the MCP, use descriptive prompts for image generation (e.g., "Generate an image of a sunset over mountains").
  2. Verify that you can request image generation and that the results include a temporary URL for download.

Note: If you encounter network or authentication errors, double-check that the BFL_API_KEY is correct and that your environment can access the BFL API endpoints.

Additional notes

Tips and common issues:

  • Ensure Node.js 22+ is installed; older Node versions may cause compatibility issues with the npx package.
  • Keep your BFL API key secure; do not share it in public repos or logs.
  • The generated image URL is only valid for 10 minutes—plan to download or cache the image promptly after it’s created.
  • If you modify the MCP configuration, reload or restart the MCP service to apply changes.
  • If you see rate-limit or API errors from BFL, check your API plan and quota on the BFL dashboard, and consider adding retries with backoff in your prompts.

Related MCP Servers

Sponsor this space

Reach thousands of developers