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

flux-bfl-mcp

v1.0.0

Published

MCP server for FLUX.2 image generation and editing using BFL API

Readme

flux-bfl-mcp

npm version License: MIT

A Model Context Protocol (MCP) server for FLUX.2 image generation and editing using the BFL (Black Forest Labs) API. This server provides two powerful tools to generate and edit images through AI.

Features

🔧 Tools

flux_generate

Generate images using FLUX.2 AI models.

Parameters:

  • prompt (required): Text description of the image to generate
  • model (optional): FLUX.2 model to use ("pro" or "flex", default: "pro")
  • width (optional): Output width in pixels (multiple of 16, default: 1024)
  • height (optional): Output height in pixels (multiple of 16, default: 1024)
  • safety_tolerance (optional): Moderation level (0-5, default: 2)
  • seed (optional): Random seed for reproducible results
  • output_format (optional): Output image format ("jpeg" or "png", default: "jpeg")
  • steps (optional): Number of inference steps (1-50, flex only, default: 50)
  • guidance (optional): Guidance scale (1.5-10, flex only, default: 4.5)

flux_edit

Edit existing images using FLUX.2 AI models.

Parameters:

  • prompt (required): Text description of the edit to be applied
  • input_image (required): Path to input image file (local) or image URL
  • model (optional): FLUX.2 model to use ("pro" or "flex", default: "pro")
  • reference_images (optional): Additional reference image files or URLs (max 7 for pro, 9 for flex)
  • width (optional): Output width in pixels (multiple of 16, defaults to input dimension)
  • height (optional): Output height in pixels (multiple of 16, defaults to input dimension)
  • safety_tolerance (optional): Moderation level (0-5, default: 2)
  • seed (optional): Random seed for reproducible results
  • output_format (optional): Output image format ("jpeg" or "png", default: "jpeg")
  • steps (optional): Number of inference steps (1-50, flex only, default: 50)
  • guidance (optional): Guidance scale (1.5-10, flex only, default: 4.5)

Installation

Via npm (recommended)

# Install globally
npm install -g flux-bfl-mcp

# Or install locally
npm install flux-bfl-mcp

Via npx (for one-time use)

npx flux-bfl-mcp --help

From source

git clone https://github.com/Lunar-feedmob/Lunar_MCP_Project.git
cd Lunar_MCP_Project
cd flux-server  # Adjust path if different
npm install
npm run build

Configuration

1. Get BFL API Key

Visit Black Forest Labs to get your API key.

2. Configure MCP Server

For Claude Desktop

Add to your MCP configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "flux-bfl": {
      "command": "npx",
      "args": ["-y", "flux-bfl-mcp"],
      "env": {
        "BFL_API_KEY": "your-bfl-api-key-here"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

For other MCP clients (like Cline)

For Cline, add to: /home/codespace/.vscode-remote/data/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

{
  "mcpServers": {
    "flux-bfl": {
      "command": "npx",
      "args": ["-y", "flux-bfl-mcp"],
      "env": {
        "BFL_API_KEY": "your-bfl-api-key-here"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Usage Examples

Generate an Image

// Using the flux_generate tool
{
  "prompt": "A serene landscape with mountains and a lake at sunset",
  "width": 1024,
  "height": 768,
  "model": "pro"
}

Edit an Image

// Using the flux_edit tool
{
  "prompt": "Add a small boat on the lake and make the sky more dramatic",
  "input_image": "https://example.com/image.jpg",
  "model": "flex",
  "steps": 35,
  "guidance": 6.5
}

API Details

This server uses the Black Forest Labs FLUX.2 API. All parameters are passed through to the BFL API with appropriate validation:

  • Pro Model: High-quality, fast generation
  • Flex Model: More customizable with adjustable steps and guidance
  • Dimensions: Must be multiples of 16 pixels
  • Safety: 0 = most permissive, 5 = most restrictive

Development

# Install dependencies
npm install

# Build the server
npm run build

# Auto-build with watch mode
npm run watch

# Test with inspector
npm run inspector

Requirements

  • Node.js 18+
  • Valid BFL API key
  • MCP-compatible client (Claude Desktop, Cline, etc.)

License

MIT - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Credits

Built with the Model Context Protocol SDK and uses the Black Forest Labs FLUX.2 API.