flux-img-mcp
Flux Image MCP Server
Documentation
Flux Image MCP Server
This MCP server provides image generation capabilities using the Flux Schnell model on Replicate.
Installation
0. Install the MCP SDK globally:
npm install -g @modelcontextprotocol/sdk@latest1. 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 install2. Build the server:
npm run build3. 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:
flux-img
generate_image
{
"prompt": "A beautiful sunset over mountains"
}The tool will return a JSON response containing:
- `status`: The status of the generation request
- `output`: The URL of the generated image (if successful)
- `error`: Any error message (if failed)
Development
To make changes to the server:
1. Modify the source code in `src/index.ts`
2. Rebuild the server: `npm run build`
3. 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
Frequently asked questions
What is flux-img-mcp?
flux-img-mcp is Flux Image MCP Server
How do I install flux-img-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is flux-img-mcp open source?
Yes — it is hosted on GitHub at https://github.com/ckz/flux-img-mcp and has 2 stars.
Related MCP tools
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
Use any LLMs (Large Language Models) for Deep Research. Support SSE API and MCP server.
Enhanced MCP server for interactive user feedback and command execution in AI-assisted development, featuring dual interface support (Web UI and Desktop Application) with intelligent environment detection and cross-platform compatibility.
A powerful Zotero AI and MCP plugin with ChatGPT, Gemini 3.7, Claude Fable 5, Claude Opus 5, DeepSeek V4, Grok, OpenRouter, Kimi k3, GLM 5.3, SiliconFlow, GPT-oss, Gemma 4, Qwen 3.8
Connect your browser to AI models. Just use Dia on Chrome, Arc or Firefox.
文颜 MCP Server 可以让 AI 自动将 Markdown 文章排版后发布至微信公众号。
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP