Flux Image MCP Server
Enables image generation using the Flux Schnell model hosted on Replicate, allowing users to create images based on text prompts.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Flux Image MCP Servergenerate a photo of a futuristic city at night with flying cars"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Flux Image MCP Server
This MCP server provides image generation capabilities using the Flux Schnell model on Replicate.
Installation
Install the MCP SDK globally:
npm install -g @modelcontextprotocol/sdk@latestClone this repository to your MCP servers directory:
cd ~/Documents/Cline/MCP
git clone https://github.com/yourusername/flux-img-mcp.git
cd flux-img-mcp
npm installBuild the server:
npm run buildAdd the server configuration to your MCP settings file (either global or workspace):
{
"mcpServers": {
"flux-img": {
"command": "node",
"args": ["/path/to/flux-img-mcp/build/index.js"],
"env": {
"REPLICATE_API_TOKEN": "your-replicate-api-token"
},
"disabled": false,
"alwaysAllow": []
}
}
}Related MCP server: Flux Schnell MCP Server
Configuration
The server requires the following environment variable:
REPLICATE_API_TOKEN: Your Replicate API token. You can get this from your Replicate account settings.
Usage
Once installed and configured, the server provides the following tool:
generate_image
Generates an image using the Flux Schnell model based on a text prompt.
Parameters:
prompt(string, required): Text description of the desired image
Example usage:
<use_mcp_tool>
<server_name>flux-img</server_name>
<tool_name>generate_image</tool_name>
<arguments>
{
"prompt": "A beautiful sunset over mountains"
}
</arguments>
</use_mcp_tool>The tool will return a JSON response containing:
status: The status of the generation requestoutput: The URL of the generated image (if successful)error: Any error message (if failed)
Development
To make changes to the server:
Modify the source code in
src/index.tsRebuild the server:
npm run buildRestart the MCP server for changes to take effect
Error Handling
The server includes comprehensive error handling for:
Missing API token
Invalid parameters
API request failures
Network issues
Security
Never commit your Replicate API token to version control
Always provide the token through environment variables
The server validates all input parameters before making API requests
This server cannot be deployed
Maintenance
Related MCP Connectors
Create images and videos from prompts, with options for image mixing, reference images, and start/…
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
AI image, video & music generation. Flux, Veo 3.1, Suno V5. Free tier included.
Generate, edit, and explore AI images. Flux, Imagen, LoRA identity swap, upscale, and more.
Related MCP Servers
- AlicenseBqualityBmaintenanceMCP for Replicate Flux Model. Generating images by prompts770 npm107MIT
- AlicenseNot gradedqualityDmaintenanceA server that enables generating images through the Replicate API by calling the Flux Schnell model via the Model Context Protocol (MCP).3MIT
- AlicenseBqualityFmaintenanceProvides image generation capabilities for Claude using the Replicate Flux model, allowing users to create images from text prompts with customizable parameters like aspect ratio and output format.161 npm51MIT
- AlicenseBqualityDmaintenanceExposes Replicate's FLUX image generation models to Claude, enabling text-to-image generation, image variations, inpainting, and edge-guided creation with 6 different FLUX models.21MIT