Flux Image MCP Server
Generate images using Replicate's Flux Schnell model.
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@latest
- Clone 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 install
- Build the server:
npm run build
- Add 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": []
}
}
}
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.ts - Rebuild the server:
npm run build - Restart 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
Related Servers
Text-to-Speech (TTS)
A Text-to-Speech server supporting multiple backends like macOS say, ElevenLabs, Google Gemini, and OpenAI TTS.
D&D MCP Server
A server for managing Dungeons & Dragons campaigns, storing all data in local JSON files.
Omics AI MCP Server
Interact with Omics AI Explorer networks for genomics research and data analysis.
KSeF
MCP server for Poland's national e-invoicing system KSeF (Krajowy System e-Faktur). Provides 12 tools for complete KSeF API integration including session management, invoice querying/submission, export generation, and system monitoring. Built with Rust for reliability and performance. Perfect for Polish businesses automating e-invoicing processes and developers building KSeF compliance tools.
3D Cartoon Generator & File System Tools
Generates 3D-style cartoon images using Google's Gemini AI and provides secure file system operations.
Mercury MCP
Mercury MCP lets you ask questions about your banking balances, transactions, cards/recipients, and more
OctoEverywhere For 3D Printing
A 3D Printing MCP server that allows for querying for live state, webcam snapshots, and 3D printer control.
Brick Directory
MCP that knows everything about LEGO sets, parts, minifigures, and pricing. Help you manage your collections across popular sites such as Rebrickable and BrickEconomy
Upstox MCP Server
A Model Context Protocol (MCP) server that integrates with the Upstox Trading API, enabling AI agents like Claude to securely access Indian stock market data, perform technical analysis, and view account information in read-only mode.
mycop
AI code security scanner with 100 built-in rules covering OWASP Top 10 and CWE Top 25