npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

bfl-mcp-server

v1.0.3

Published

Model Context Protocol server for Black Forest Labs FLUX image generation and editing

Readme

BFL MCP Server

Model Context Protocol (MCP) server for Black Forest Labs FLUX image generation and editing using FLUX.1 Kontext Pro.

🎨 Create and edit images with AI using natural language through the MCP protocol

Features

  • 🎨 Image Generation: Generate high-quality images from text prompts using FLUX.1 Kontext Pro
  • ✏️ Image Editing: Edit existing images with natural language instructions
  • 🚀 Easy Installation: Run directly with npx - no local setup required
  • 🔧 Configurable: Support for aspect ratios, seeds, safety settings, and output formats
  • 🔗 MCP Compatible: Works with Claude Desktop, Claude Code, and other MCP clients

Installation & Usage

Quick Start with npx

# Run the MCP server with your BFL API key
npx bfl-mcp-server YOUR_BFL_API_KEY

Environment Variable

# Set environment variable
export BFL_API_KEY="your-api-key-here"
npx bfl-mcp-server

IDE Integration

Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

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

Claude Code

  1. Via CLI Wizard (Recommended):
claude mcp add bfl-server -e BFL_API_KEY=your-api-key-here -- npx bfl-mcp-server
  1. Via .claude.json (Project-specific): Create or edit .claude.json in your project root:
{
  "mcpServers": {
    "bfl": {
      "command": "npx",
      "args": ["bfl-mcp-server"],
      "env": {
        "BFL_API_KEY": "your-api-key-here"
      }
    }
  }
}
  1. Using Environment Variables:
{
  "mcpServers": {
    "bfl": {
      "command": "npx",
      "args": ["bfl-mcp-server"],
      "env": {
        "BFL_API_KEY": "${BFL_API_KEY}"
      }
    }
  }
}

Cursor IDE

  1. Enable MCP: Go to Settings > Cursor Settings > MCP Servers and enable it

  2. Project Configuration: Create .cursor/mcp.json in your project:

{
  "mcpServers": {
    "bfl": {
      "command": "npx",
      "args": ["-y", "bfl-mcp-server"],
      "env": {
        "BFL_API_KEY": "your-api-key-here"
      }
    }
  }
}
  1. Global Configuration: Create ~/.cursor/mcp.json for system-wide access:
{
  "mcpServers": {
    "bfl": {
      "command": "npx",
      "args": ["-y", "bfl-mcp-server"],
      "env": {
        "BFL_API_KEY": "your-api-key-here"
      }
    }
  }
}

Windsurf IDE

  1. Via Plugin Store:

    • Open Windsurf and navigate to Cascade assistant
    • Click the Plugins icon in the top right menu
    • Add custom server with our package
  2. Manual Configuration:

    • Click the hammer (MCP) icon in Cascade
    • Click "Configure" to open ~/.codeium/windsurf/mcp_config.json
    • Add configuration:
{
  "mcpServers": {
    "bfl": {
      "command": "npx",
      "args": ["-y", "bfl-mcp-server"],
      "env": {
        "BFL_API_KEY": "your-api-key-here"
      }
    }
  }
}
  1. Reload: Save and click "Refresh" in the Cascade assistant

Available Tools

generate_image

Generate an image from a text prompt.

Parameters:

  • prompt (required): Text description of the image to generate
  • aspect_ratio (optional): Image aspect ratio (default: "1:1")
    • Supported: "1:1", "16:9", "9:16", "4:3", "3:4", etc.
  • seed (optional): Seed for reproducible generation
  • safety_tolerance (optional): Safety level 0-6 (higher = more permissive)
  • output_format (optional): "jpeg" or "png" (default: "jpeg")

Example:

{
  "name": "generate_image",
  "arguments": {
    "prompt": "A beautiful sunset over mountains with a lake reflection",
    "aspect_ratio": "16:9",
    "output_format": "jpeg"
  }
}

edit_image

Edit an existing image using natural language instructions.

Parameters:

  • prompt (required): Text description of how to edit the image
  • input_image (required): Base64 encoded input image
  • aspect_ratio (optional): Output image aspect ratio (default: "1:1")
  • seed (optional): Seed for reproducible generation
  • safety_tolerance (optional): Safety level 0-6
  • output_format (optional): "jpeg" or "png" (default: "jpeg")

Example:

{
  "name": "edit_image",
  "arguments": {
    "prompt": "Change the sky to be stormy with dark clouds",
    "input_image": "base64-encoded-image-data",
    "aspect_ratio": "16:9"
  }
}

Verification & Troubleshooting

Verify Installation

After configuring in any IDE, you should see:

  • Claude Desktop: MCP tools available in chat
  • Claude Code: Run /mcp command to check status
  • Cursor: Green dot with tools list in MCP section
  • Windsurf: Tools available in Cascade assistant

Common Issues

  1. "Command not found": Ensure npx is installed (npm install -g npm)
  2. "Permission denied": Try with sudo or check Node.js permissions
  3. "API key invalid": Verify your BFL API key at bfl.ai
  4. "Server not starting": Check IDE logs for detailed error messages

Testing the Server

Test manually before IDE integration:

# Test the server directly
npx bfl-mcp-server your-api-key

# Should show: "BFL MCP Server running on stdio"

API Key

Get your API key from Black Forest Labs.

Technical Details

  • Model: FLUX.1 Kontext Pro
  • Output: ~1MP images (1024x1024 for 1:1 ratio)
  • URL Validity: Generated image URLs are valid for 10 minutes
  • Processing: Asynchronous with automatic polling
  • Timeout: 5 minutes maximum generation time

Development

Local Development

# Clone and install
git clone https://github.com/elhombrehd/bfl_mcp.git
cd bfl_mcp
npm install

# Build
npm run build

# Test with API key
BFL_API_KEY="your-key" npm run dev

Testing

# Run API tests
node test.js

Author

Created by @elhombrehd

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

Repository

🔗 GitHub: github.com/elhombrehd/bfl_mcp