Image Generation (Flux-Schnell)
FreeNot checkedEnables text-to-image generation using Replicate's flux-schnell model, offering configurable parameters for on-demand image creation in various applications.
About
Enables text-to-image generation using Replicate's flux-schnell model, offering configurable parameters for on-demand image creation in various applications.
README
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
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 |
|---|---|---|---|---|
prompt |
string | Yes | - | Text prompt for image generation |
output_dir |
string | Yes | - | Server directory path to save generated images |
go_fast |
boolean | No | false | Enable faster generation mode |
megapixels |
string | No | "1" | Resolution quality ("1", "2", "4") |
num_outputs |
number | No | 1 | Number of images to generate (1-4) |
aspect_ratio |
string | No | "1:1" | Aspect ratio ("1:1", "4:3", "16:9") |
output_format |
string | No | "webp" | Image format ("webp", "png", "jpeg") |
output_quality |
number | No | 80 | Compression quality (1-100) |
num_inference_steps |
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
Installing Image Generation (Flux-Schnell)
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/mikeyny/ai-image-gen-mcpFAQ
Is Image Generation (Flux-Schnell) MCP free?
Yes, Image Generation (Flux-Schnell) MCP is free — one-click install via Unyly at no cost.
Does Image Generation (Flux-Schnell) need an API key?
No, Image Generation (Flux-Schnell) runs without API keys or environment variables.
Is Image Generation (Flux-Schnell) hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Image Generation (Flux-Schnell) in Claude Desktop, Claude Code or Cursor?
Open Image Generation (Flux-Schnell) on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
ARA
Generate images, video and audio from any AI agent — one connector.
by ARAOmni Video
An MCP server that transforms LLM-enabled IDEs into professional video editors by pre-processing footage into text proxies, generating motion graphics via HTML/
by buildwithtazaYouTube
Transcripts, channel stats, search
by YouTubeEverArt
AI image generation using various models.
by modelcontextprotocolgpu-bridge/mcp-server
GPU inference API for LLMs, image and video generation, TTS, Whisper, embeddings, reranking and OCR, paid per use via x402 or an API key.
by gpu-bridgemerterbak/Grok-MCP
Access xAI's Grok API with agentic tool calling, image generation, vision and file support.
by merterbakSureScaleAI/openai-gpt-image-mcp
Image generation and editing with OpenAI's GPT image models.
by SureScaleAIYangLiangwei/PersonalizationMCP
Aggregate personal data from Steam, YouTube, Bilibili, Spotify, Reddit and other gaming, music, video and social platforms, with OAuth2 and token management.
by YangLiangweiAceDataCloud/MCPFlux
Flux image generation and editing from Black Forest Labs via the Ace Data Cloud API.
by AceDataCloudAceDataCloud/MCPNanoBanana
Nano Banana image generation and editing, including virtual try-on and product placement in realistic scenes.
by AceDataCloudCompare Image Generation (Flux-Schnell) with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All media MCPs
