home / mcp / image generation mcp server
This MCP server provides image generation capabilities using the Replicate Flux model.
Configuration
View docs{
"mcpServers": {
"gongrzhe-image-generation-mcp-server": {
"command": "npx",
"args": [
"-y",
"@gongrzhe/image-gen-server"
],
"env": {
"MODEL": "optional-model-name",
"REPLICATE_API_TOKEN": "YOUR_REPLICATE_API_TOKEN"
}
}
}
}You can generate images automatically by running the Image Generation MCP Server, which uses the Replicate Flux model. This MCP lets you request artwork from text prompts and receive image URLs in return, making it easy to plug image generation into your workflows or chat clients.
Use an MCP client to call the image_gen_mcp server and request images with a text prompt. You can customize the output by adjusting the prompt, aspect ratio, and number of images. The server returns URLs to the generated images, which you can display or save as needed. The default model is Flux Schnell, but you can switch models via configuration if you provide a different MODEL value.
Prerequisites you need before installation: Node.js and npm installed on your system.
Option 1: NPX Method (No Local Setup Required) You can run the server directly from npm without installing it locally. Use the NPX approach to avoid local setup.
Option 2: Local Installation You can install the package locally or globally so you can run it from your environment.
# Smithery install (optional helper for Claude Desktop integration)
npx -y @smithery/cli install @GongRzhe/Image-Generation-MCP-Server --client claude
# NPX method (no local setup required)
# No installation needed - npx will handle it
```,"language":null}]},{Configuration details include how to connect to Replicate and choose a model. You need a Replicate API token and can set MODEL to the specific model name you want to use. The Flux model defaults to black-forest-labs/flux-schnell if you do not provide a model.
Get your Replicate API token: 1) Sign up or log in to Replicate 2) Create a new API token 3) Copy the token and insert it into the MCP settings as REPLICATE_API_TOKEN.
Environment variables you’ll encounter include REPLICATE_API_TOKEN (required) and MODEL (optional, defaults to black-forest-labs/flux-schnell). The server’s behavior is controlled by the disabled flag and the autoApprove list, which you can use to permit certain tools to run without extra confirmation.
Example usage from the client side shows how to invoke the generate_image tool with a prompt and optional parameters like seed, aspect_ratio, output_format, and num_outputs. The server returns an array of image URLs.
Generates images using the Flux model based on text prompts. You can specify prompt, seed, aspect_ratio, output_format, and num_outputs to tailor the results. Returns an array of image URLs.