Replicate Flux MCP is an advanced Model Context Protocol (MCP) server that empowers AI assistants to generate high-quality images and vector graphics. Leveraging Black Forest Labs' Flux Schnell model for raster images and Recraft's V3 SVG model for vector graphics via the Replicate API.
generate_svg
.cursor/mcp.json
file in your project directory:{
"mcpServers": {
"replicate-flux-mcp": {
"command": "env REPLICATE_API_TOKEN=YOUR_TOKEN npx",
"args": ["-y", "replicate-flux-mcp"]
}
}
}
YOUR_TOKEN
with your actual Replicate API tokenenv REPLICATE_API_TOKEN=YOUR_TOKEN npx -y replicate-flux-mcp
YOUR_TOKEN
with your actual Replicate API tokenmcp.json
file in your configuration directory:{
"mcpServers": {
"replicate-flux-mcp": {
"command": "npx",
"args": ["-y", "replicate-flux-mcp"],
"env": {
"REPLICATE_API_TOKEN": "YOUR TOKEN"
}
}
}
}
YOUR_TOKEN
with your actual Replicate API tokenThis MCP server is available as a hosted service on Smithery, allowing you to use it without setting up your own server.
For more information on using Smithery with your MCP clients, visit the Smithery documentation.
This MCP server is also available as a hosted service on Glama.ai, providing another option to use it without local setup.
For more information, visit the Glama.ai MCP servers documentation.
generate_image
Generates an image based on a text prompt using the Flux Schnell model.
{
prompt: string; // Required: Text description of the image to generate
seed?: number; // Optional: Random seed for reproducible generation
go_fast?: boolean; // Optional: Run faster predictions with optimized model (default: true)
megapixels?: "1" | "0.25"; // Optional: Image resolution (default: "1")
num_outputs?: number; // Optional: Number of images to generate (1-4) (default: 1)
aspect_ratio?: string; // Optional: Aspect ratio (e.g., "16:9", "4:3") (default: "1:1")
output_format?: string; // Optional: Output format ("webp", "jpg", "png") (default: "webp")
output_quality?: number; // Optional: Image quality (0-100) (default: 80)
num_inference_steps?: number; // Optional: Number of denoising steps (1-4) (default: 4)
disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)
}
generate_multiple_images
Generates multiple images based on an array of prompts using the Flux Schnell model.
{
prompts: string[]; // Required: Array of text descriptions for images to generate (1-10 prompts)
seed?: number; // Optional: Random seed for reproducible generation
go_fast?: boolean; // Optional: Run faster predictions with optimized model (default: true)
megapixels?: "1" | "0.25"; // Optional: Image resolution (default: "1")
aspect_ratio?: string; // Optional: Aspect ratio (e.g., "16:9", "4:3") (default: "1:1")
output_format?: string; // Optional: Output format ("webp", "jpg", "png") (default: "webp")
output_quality?: number; // Optional: Image quality (0-100) (default: 80)
num_inference_steps?: number; // Optional: Number of denoising steps (1-4) (default: 4)
disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)
}
generate_image_variants
Generates multiple variants of the same image from a single prompt.
{
prompt: string; // Required: Text description for the image to generate variants of
num_variants: number; // Required: Number of image variants to generate (2-10, default: 4)
prompt_variations?: string[]; // Optional: List of prompt modifiers to apply to variants (e.g., ["in watercolor style", "in oil painting style"])
variation_mode?: "append" | "replace"; // Optional: How to apply variations - 'append' adds to base prompt, 'replace' uses variations directly (default: "append")
seed?: number; // Optional: Base random seed. Each variant will use seed+variant_index
go_fast?: boolean; // Optional: Run faster predictions with optimized model (default: true)
megapixels?: "1" | "0.25"; // Optional: Image resolution (default: "1")
aspect_ratio?: string; // Optional: Aspect ratio (e.g., "16:9", "4:3") (default: "1:1")
output_format?: string; // Optional: Output format ("webp", "jpg", "png") (default: "webp")
output_quality?: number; // Optional: Image quality (0-100) (default: 80)
num_inference_steps?: number; // Optional: Number of denoising steps (1-4) (default: 4)
disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)
}
generate_svg
Generates an SVG vector image based on a text prompt using the Recraft V3 SVG model.
{
prompt: string; // Required: Text description of the SVG to generate
size?: string; // Optional: Size of the generated SVG (default: "1024x1024")
style?: string; // Optional: Style of the generated image (default: "any")
// Options: "any", "engraving", "line_art", "line_circuit", "linocut"
}
prediction_list
Retrieves a list of your recent predictions from Replicate.
{
limit?: number; // Optional: Maximum number of predictions to return (1-100) (default: 50)
}
get_prediction
Gets detailed information about a specific prediction.
{
predictionId: string; // Required: ID of the prediction to retrieve
}
imagelist
Browse your history of generated images created with the Flux Schnell model.
svglist
Browse your history of generated SVG images created with the Recraft V3 SVG model.
predictionlist
Browse all your Replicate predictions history.
git clone https://github.com/yourusername/replicate-flux-mcp.git
cd replicate-flux-mcp
npm install
npm run dev
npm run build
{
"mcpServers": {
"image-generation-mcp": {
"command": "npx",
"args": [\
"/Users/{USERNAME}/{PATH_TO}/replicate-flux-mcp/build/index.js"\
],
"env": {
"REPLICATE_API_TOKEN": "YOUR REPLICATE API TOKEN"
}
}
}
}
The server can be configured by modifying the CONFIG
object in src/config/index.ts
:
const CONFIG = {
serverName: "replicate-flux-mcp",
serverVersion: "0.1.2",
imageModelId: "black-forest-labs/flux-schnell",
svgModelId: "recraft-ai/recraft-v3-svg",
pollingAttempts: 25,
pollingInterval: 2000, // ms
};
REPLICATE_API_TOKEN
is correctly set in the environmentpollingAttempts
or pollingInterval
in the configurationContributions are welcome! Please follow these steps to contribute:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)For feature requests or bug reports, please create a GitHub issue. If you like this project, consider starring the repository!
This project is licensed under the MIT License - see the LICENSE file for details.
Multiple Prompts | Prompt Variants |
---|---|
![]() |
![]() |
Here are some examples of how to use the tools:
generate_multiple_images
Create multiple distinct images at once with different prompts:
{
"prompts": [\
"A red sports car on a mountain road", \
"A blue sports car on a beach", \
"A vintage sports car in a city street"\
]
}
generate_image_variants
Create different interpretations of the same concept using seeds:
{
"prompt": "A futuristic city skyline at night",
"num_variants": 4,
"seed": 42
}
Or explore style variations with prompt modifiers:
{
"prompt": "A character portrait",
"prompt_variations": [\
"in anime style", \
"in watercolor style", \
"in oil painting style", \
"as a 3D render"\
]
}
Made with ❤️ by Yaroslav Boiko