Flux Cloudflare

Provides an MCP-enabled interface to generate images via Flux through a Cloudflare Worker API and returns text completions.
  • typescript

0

GitHub Stars

typescript

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You run a Flux MCP Server that lets AI assistants generate images using Flux via a Cloudflare Worker API. This server acts as a bridge between your MCP clients and the Flux image-generation service, handling authentication, routing, and parameter control so you can request images from prompts with consistent behavior and safe processing.

How to use

You connect an MCP client to the Flux Cloudflare MCP server to generate images from text prompts. You can route image generation through either a deployed Flux API endpoint (via a Cloudflare Worker) or a local/remote MCP setup that your client already knows, then send prompts and optional parameters to customize the results. Use the MCP server to obtain both image data and text completions from the same API surface.

To generate an image, provide a prompt and optional settings such as the number of inference steps or aspect ratio. The server translates your request to Flux and returns the generated image along with a text completion if you request one. This setup is compatible with popular MCP clients, so you can integrate it into existing chat or automation workflows.

How to install

Prerequisites you need before installation: Node.js installed on your machine (version 14+ recommended) and npm available in your environment.

Directly with NPX (quick start) you can run the MCP server without cloning the repo.

FLUX_API_TOKEN=your_token FLUX_API_URL=your_api_url npx -y flux-cloudflare-mcp

If you prefer to build from source, follow these steps to clone, install, and build the project.

# Clone the repository
git clone https://github.com/Hzzy2O/flux-cloudflare-mcp.git
cd flux-cloudflare-mcp

# Install dependencies
npm install

# Build the project
npm run build

Additional notes

Configuration and runtime details center on two deployment paths for the Flux API: a Cloudflare Worker-based Flux API endpoint or a feature-rich web UI alternative. Choose the path that matches your needs.

  1. Deploy a Flux API worker (recommended). This creates a Cloudflare Worker that exposes Flux under your own URL. You can deploy a forked worker, connect it to your Cloudflare account, and set environment variables such as the API key, account id, and Flux model. The resulting endpoint becomes your FLUX_API_URL. You then provide FLUX_API_TOKEN as your authentication token.

  2. Deploy a feature-rich Flux API with a web UI. This path provides an extended interface while still exposing an API endpoint. After deployment, use the deployed URL as FLUX_API_URL and set FLUX_API_TOKEN with your credentials.

The MCP server expects these environment variables to be present at runtime: FLUX_API_TOKEN and FLUX_API_URL.

// Example mcpServers configuration (stdio) you can run via an MCP client
{
  "mcpServers": {
    "flux_cloudflare": {
      "command": "env FLUX_API_TOKEN=YOUR_TOKEN FLUX_API_URL=YOUR_API_URL npx",
      "args": ["-y", "flux-cloudflare-mcp"]
    }
  }
}

Troubleshooting

Authentication errors usually mean the FLUX_API_TOKEN is missing or invalid. Verify the token you supply matches what Flux expects and ensure it’s set in your environment properly.

If you encounter API connection issues, confirm that the Flux API endpoint is reachable from your network and that the Cloudflare Worker hosting the Flux API is operational.

If prompts trigger safety filters, adjust your prompt to avoid restricted content while preserving the desired output.

Notes on security and usage

All requests pass through the Cloudflare Worker, providing a controlled surface for image generation and text completion. Protect your API tokens and avoid exposing them in client-side code.

Keep Flux API tokens and the associated API URL confidential. Rotate tokens if you suspect compromise and monitor usage for unusual activity.

Available tools

generate_image

Generates an image using the Flux model based on a text prompt. Accepts optional parameters for denoising steps and aspect ratio.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational