Enables image generation using the Flux Schnell model hosted on Replicate, allowing users to create images based on text prompts.
Flux Image MCP Server
This MCP server provides image generation capabilities using the Flux Schnell model on Replicate.
Installation
Install the MCP SDK globally:
Clone this repository to your MCP servers directory:
Build the server:
Add the server configuration to your MCP settings file (either global or workspace):
Related MCP server: Image Generation 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:
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