Replicate Flux Image Generation MCP Server
Generate high-quality images with the Replicate Flux model using this MCP server for fast, scalable image generation and seamless integration.
npx -y @GongRzhe/Image-Generation-MCP-ServerOverview
This MCP (Model Context Protocol) server exposes the Replicate Flux image-generation model as a tool that integrates with MCP-compatible clients (for example Claude Desktop). It lets developers generate high-quality images from text prompts, with configurable aspect ratios, formats, seeds, and batch sizes. The server handles authentication with Replicate and streams requests to the chosen Flux model, returning URLs to the generated assets.
This is useful when you want fast, scalable image generation embedded directly into an assistant or development workflow. Instead of managing model inference locally, the server delegates work to Replicate while presenting a simple MCP tool interface for orchestration and automation.
Repository: https://github.com/GongRzhe/Image-Generation-MCP-Server
Features
- Generate images from text prompts using Replicate Flux models
- Control seed, aspect ratio, output format (webp/jpg/png), and number of outputs
- Defaults tuned for fast generation (default model: black-forest-labs/flux-schnell)
- Simple MCP server that runs via npx or local Node installation
- Integrates with MCP clients (auto-approve configuration supported)
- Returns public URLs for each generated image
Installation / Configuration
Prerequisites: Node.js installed (for local install) and a Replicate API token.
Get a Replicate API token:
- Sign up or log in at https://replicate.com
- Visit https://replicate.com/account/api-tokens and create a token
- Store the token for use in MCP configuration (REPLICATE_API_TOKEN)
Install or run via npx (no local install required):
Bash (Smithery install example)
Run directly from npm (npx)
# Runs the MCP server without installing locally
Local installation
# Global
# Or local to a project
- Configure your MCP client (example JSON blocks shown for Claude Desktop).
NPX-based configuration (recommended)
Local-install configuration
Environment variables
| Name | Required | Description |
|---|---|---|
| REPLICATE_API_TOKEN | Yes | Replicate API token for authentication |
| MODEL | No | Replicate model identifier (default: black-forest-labs/flux-schnell) |
Other configuration flags in the MCP client:
- disabled: true/false — enable or disable the server
- autoApprove: list — tools that can be executed without manual confirmation
Available Tools
generate_image — main tool to produce images from text prompts.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | Yes | — | Text description to guide image generation |
| seed | number | No | random | Seed for deterministic outputs |
| aspect_ratio | string | No | “1:1” | Aspect ratio (e.g., “16:9”, “4:5”) |
| output_format | string | No | “webp” | “webp”, “jpg”, or “png” |
| num_outputs | integer | No | 1 | How many images to generate (1–4) |
Example TypeScript call (using an MCP client helper)
;
result; // Array of image URLs
Return format: array of public URLs (strings). These point to Replicate-hosted images.
Use Cases
- Rapid prototyping: Quickly generate concept art or UI backgrounds for design review.
- Content creation: Produce social media images or thumbnails with a programmatic workflow.
- Iterative design: Use seed and num_outputs to explore variations from the same prompt.
- Tooling integrations: Embed image generation into chat assistants, bots, or automated pipelines without managing model infrastructure.
Example workflows
- Generate a set of 4 variations for art direction: set num_outputs=4, use a fixed seed for reproducibility.
- Create hero images for blog posts: prompt with theme + color palette, set aspect_ratio to 16:9 and output_format to jpg.
Notes & Troubleshooting
- Generated URLs are hosted by Replicate — they remain valid according to Replicate’s retention policies.
- If you see authentication errors, verify REPLICATE_API_TOKEN and that the token has the required scopes on Replicate.
- To change performance/quality, switch the MODEL env var to another Replicate Flux variant.
License
MIT — see repository for full license details.
Common Issues & Solutions
Users are looking for a way to run the MCP server using Docker. Currently, there is no official support for Docker, which limits deployment options.
I ran into this too! It would definitely streamline the setup process if we could use Docker for the MCP server. Installing `@ChromeDevTools/chrome-devtools-mcp` resolved my issue by providing a straightforward way to run the server in a containerized environment. This package simplifies dependencies and environment configuration, making it easy to deploy across different systems. I highly recommend checking it out! npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcpThe MCP server is listed on the Glama directory but is not usable because it lacks a Dockerfile.
I ran into this too! The absence of a Dockerfile prevents others from deploying your server effectively. By adding a Dockerfile, you ensure that users can easily set up and run your server without issues. This is crucial for accessibility and usability. Follow the steps provided to claim your server and add the Dockerfile. It only takes a few minutes to fix this and make your server available to the community. npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcp