Image Generator MCP Server
The Image Generator MCP Server allows users to generate, save, and manage images using Replicate's Stable Diffusion model.
Generate Images: Create images by providing a text prompt and optional parameters like width, height, guidance_scale, negative_prompt, and num_inference_steps.
Save Images: Store generated images locally with options for custom filenames and target directories.
List Saved Images: Retrieve all saved images along with their metadata and thumbnails.
Access Images: View saved images via a custom
image://URI scheme.Configure Image Style: Optionally specify image style (realistic/artistic/abstract) when generating prompts.
Generates images using Replicate's Stable Diffusion model through their API. Requires a Replicate API token to authenticate and make requests to their image generation services.
Click on "Install 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 Generator MCP Servergenerate a realistic photo of a sunset over mountains"
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 Generator MCP Server
An MCP server that uses Replicate to generate images and allows users to save them.
Components
Resources
The server implements an image storage system with:
Custom image:// URI scheme for accessing individual generated images
Each image resource has a name based on its prompt, description with creation date, and image/png mimetype
Prompts
The server provides a single prompt:
generate-image: Creates prompts for generating images using Stable Diffusion
Optional "style" argument to control the image style (realistic/artistic/abstract)
Generates a prompt template with style-specific guidance
Tools
The server implements three tools:
generate-image: Generates an image using Replicate's Stable Diffusion model
Takes "prompt" as a required string argument
Optional parameters include "negative_prompt", "width", "height", "num_inference_steps", and "guidance_scale"
Returns the generated image and its URL
save-image: Saves a generated image to the local filesystem
Takes "image_url" and "prompt" as required string arguments
Generates a unique ID for the image and saves it to the "generated_images" directory
list-saved-images: Lists all saved images
Returns a list of all saved images with their metadata and thumbnails
Related MCP server: gemini-image-mcp
Configuration
Replicate API Token
To use this image generator, you need a Replicate API token:
Create an account at Replicate
Get your API token from https://replicate.com/account
Create a
.envfile based on the provided.env.exampletemplate:
REPLICATE_API_TOKEN=your_replicate_api_token_hereImportant: The
.envfile is excluded from version control via.gitignoreto prevent accidentally exposing your API token. Never commit sensitive information to your repository.
Environment Setup
Clone the repository:
git clone https://github.com/yourusername/image-generator.git
cd image-generatorCreate and activate a virtual environment:
# Using venv
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txtSet up your
.envfile as described above
Quickstart
Install
Claude Desktop
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Usage
Once the server is running, you can:
Generate an image by using the "generate-image" tool with a descriptive prompt
Save the generated image using the "save-image" tool with the image URL and prompt
View all saved images using the "list-saved-images" tool
Access saved images through the resource list
Development
Building and Publishing
To prepare the package for distribution:
Sync dependencies and update lockfile:
uv syncBuild package distributions:
uv buildThis will create source and wheel distributions in the dist/ directory.
Publish to PyPI:
uv publishNote: You'll need to set PyPI credentials via environment variables or command flags:
Token:
--tokenorUV_PUBLISH_TOKENOr username/password:
--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with this command:
npx @modelcontextprotocol/inspector uv --directory B:\NEWTEST\image-generator run image-generatorUpon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Available Tools
3 toolsgenerate-imageC
Generate an image using Replicate's Stable Diffusion model
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| height | No | ||
| prompt | Yes | ||
| guidance_scale | No | ||
| negative_prompt | No | ||
| num_inference_steps | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description alone must disclose behavior. It only states image generation, but omits whether the image is returned directly, saved, or streamed. No mention of rate limits, authentication, or potential side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, concise and front-loaded. However, it might be too terse, sacrificing critical details. Every word earns its place, but more information would improve usability.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 6 parameters, no output schema, and no annotations, the description is incomplete. It fails to clarify whether output is a URL, base64, or file path. Critical for an agent to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description provides no explanation of parameters beyond their existence. Values like 'guidance_scale', 'num_inference_steps', and 'negative_prompt' are left undefined. The agent must infer their purpose from names or defaults.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Generate an image using Replicate's Stable Diffusion model', which identifies the verb (generate), resource (image), and model. It distinguishes from siblings 'list-saved-images' and 'save-image'. However, it could be more precise by specifying 'from a text prompt'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. No mention of prerequisites, output handling, or when not to use it. The description assumes the agent already knows to use this for generation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list-saved-imagesA
List all saved images
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It only states 'List all saved images' but lacks details on pagination, ordering, or behavior when no images exist.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with one short sentence, front-loaded with the key action and resource. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no parameters and a simple output (likely an array of saved images), the description fully explains the tool's purpose without needing further elaboration.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are no parameters, and schema coverage is 100%. The description implicitly means no arguments are needed, which is sufficient and adds no extra confusion.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'List' and the resource 'all saved images'. It distinguishes this tool from its siblings 'generate-image' and 'save-image' by specifying a different action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus the sibling tools. It does not state any prerequisites or context for using this list operation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
save-imageC
Save a generated image
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| image_url | Yes | ||
| custom_filename | No | Custom filename for the saved image (without extension). If not provided, a UUID will be used. | |
| target_directory | No | Directory path where the image should be saved. If not provided, defaults to the MCP server's images directory. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description bears full responsibility for behavioral disclosure. It only states 'Save a generated image' without detailing side effects (e.g., whether it overwrites existing files, required permissions, or error handling). This is insufficient for an agent to understand the tool's behavior beyond a basic save operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, which is concise, but it sacrifices informativeness. It could be restructured to include key details without being verbose. Every sentence should add value, and this one is too vague.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (4 parameters, no output schema, no annotations), the description is extremely incomplete. It does not explain return values, error conditions, or the result of saving. The agent cannot reliably invoke this tool based solely on this description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 50% (custom_filename and target_directory have descriptions in schema, but required params prompt and image_url do not). The description adds no information about any parameter, failing to compensate for the missing schema descriptions. It does not explain what image_url or prompt mean for this tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Save a generated image' clearly identifies the verb (save) and resource (generated image), and it distinguishes from sibling tools 'generate-image' (which creates but does not persist) and 'list-saved-images' (which lists existing saves). However, it could be more specific about the storage location or context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool vs alternatives. It does not state that this should be used after an image is generated, nor does it mention scenarios where this tool might be inappropriate. With siblings like generate-image and list-saved-images, explicit usage context is missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: generating images, listing saved images, and saving images. No overlap or ambiguity.
All tools follow a consistent verb_noun snake_case pattern (generate-image, list-saved-images, save-image), making them predictable.
3 tools is appropriate for a focused image generator server, covering the core workflow. Slightly minimal but not overly sparse.
Covers generation, listing, and saving. Missing a delete or update tool, but the core lifecycle is intact and agents can work without major gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Flux AI image generation
MCP server for Qwen Image 3 AI image generation
MCP server for Grok Imagine AI video generation
MCP server for Producer/Riffusion AI music generation
Related MCP Servers
- AlicenseAqualityFmaintenanceA MCP server that integrates with Stable Diffusion WebUI to provide text-to-image generation and image upscaling capabilities through simple API calls.543MIT
- AlicenseBqualityCmaintenanceAn MCP server for image generation using the Gemini API.1382MIT
- 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
- AlicenseBqualityCmaintenanceAn MCP server that generates pixel-art PNGs from text prompts, using a free image backend, and saves them directly to your project directory.2MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rmcendarfer2017/MCP-image-gen'
If you have feedback or need assistance with the MCP directory API, please join our Discord server