Image Generation MCP Server
The Image Generation MCP Server generates images from text prompts using Replicate's black-forest-labs/flux-schnell model with customizable parameters and MCP protocol compliance for integration with clients like Cursor.
Key capabilities:
Generate images from text descriptions
Customize image properties:
Resolution (
megapixels)Aspect ratio
Output quality and format (webp, png, jpeg)
Generation speed with
go_fastoptionNumber of inference steps
Save multiple images (up to 4 per request) to a specified directory
Provide a base filename for saved images
Robust error handling for validation, API, and server issues
Integrates with Replicate's 'black-forest-labs/flux-schnell' model to generate images from text prompts
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Image Generation MCP Server generate a photo of a futuristic city skyline at sunset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Image Generation MCP Server
An MCP (Model Context Protocol) server implementation for generating images using Replicate's black-forest-labs/flux-schnell model.
Ideally to be used with Cursor's MCP feature, but can be used with any MCP client.
Features
Generate images from text prompts
Configurable image parameters (resolution, aspect ratio, quality)
Save generated images to specified directory
Full MCP protocol compliance
Error handling and validation
Related MCP server: replicate-flux-mcp
Prerequisites
Node.js 16+
Replicate API token
TypeScript SDK for MCP
Setup
Clone the repository
Install dependencies:
npm installAdd your Replicate API token directly in the code at
src/imageService.tsby updating theapiTokenconstant:// No environment variables are used since they can't be easily set in cursor const apiToken = "your-replicate-api-token-here";Note: If using with Claude, you can create a
.envfile in the root directory and set your API token there:REPLICATE_API_TOKEN=your-replicate-api-token-hereThen build the project:
npm run build
Usage
To use with cursor:
Go to Settings
Select Features
Scroll down to "MCP Servers"
Click "Add new MCP Server"
Set Type to "Command"
Set Command to:
node ./path/to/dist/server.js
API Parameters
Parameter | Type | Required | Default | Description |
| string | Yes | - | Text prompt for image generation |
| string | Yes | - | Server directory path to save generated images |
| boolean | No | false | Enable faster generation mode |
| string | No | "1" | Resolution quality ("1", "2", "4") |
| number | No | 1 | Number of images to generate (1-4) |
| string | No | "1:1" | Aspect ratio ("1:1", "4:3", "16:9") |
| string | No | "webp" | Image format ("webp", "png", "jpeg") |
| number | No | 80 | Compression quality (1-100) |
| number | No | 4 | Number of denoising steps (4-20) |
Example Request
{
"prompt": "black forest gateau cake spelling out 'FLUX SCHNELL'",
"output_dir": "/var/output/images",
"filename": "black_forest_cake",
"output_format": "webp"
"go_fast": true,
"megapixels": "1",
"num_outputs": 2,
"aspect_ratio": "1:1"
}Example Response
{
"image_paths": [
"/var/output/images/output_0.webp",
"/var/output/images/output_1.webp"
],
"metadata": {
"model": "black-forest-labs/flux-schnell",
"inference_time_ms": 2847
}
}Error Handling
The server handles the following error types:
Validation errors (invalid parameters)
API errors (Replicate API issues)
Server errors (filesystem, permissions)
Unknown errors (unexpected issues)
Each error response includes:
Error code
Human-readable message
Detailed error information
License
ISC
Available Tools
1 toolgenerate-imageC
Generate an image based on a prompt
Inputs: prompt (required), output_dir (required), filename, go_fast, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlap between tools. The single tool 'generate-image' has a clear and distinct purpose for image generation based on prompts.
The single tool name 'generate-image' follows a clear verb_noun pattern. Since there is only one tool, consistency is inherently perfect with no deviations or mixed conventions to evaluate.
A single tool is too few for a server named 'Image Generation MCP Server', which suggests a broader scope. While it covers basic generation, typical image generation domains might include variations, edits, or management tools, making this feel thin and incomplete.
The tool surface is severely incomplete for image generation. It only provides generation, with no tools for editing, resizing, filtering, or managing images, leaving obvious gaps that will limit agent capabilities in this domain.
Maintenance
Related MCP Connectors
Generate AI images and videos from any compatible MCP client.
Generate images with any major model — one API key, one prepaid balance, one MCP.
Create images & video from any MCP agent — 17 models, spend limits, one URL.
Generate images, video, audio and short films with 140+ AI models from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA FastMCP server implementation that provides a standardized interface for accessing AI models hosted on Replicate's API, currently supporting image generation with customizable parameters.3MIT
- AlicenseBqualityCmaintenanceMCP for Replicate Flux Model. Generating images by prompts71,808 npm106MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables image generation using Replicate's Flux 1.1 Pro model. It provides a tool for creating visuals from text prompts with customizable settings for aspect ratio, output format, and quality.1MIT
- AlicenseNot gradedqualityDmaintenanceProvides a standardized interface for interacting with Replicate's tools and services through a unified API, enabling AI model usage via MCP.MIT