Image Generator MCP Server
Generador de imágenes del servidor MCP
Un servidor MCP que utiliza Replicate para generar imágenes y permite a los usuarios guardarlas.
Componentes
Recursos
El servidor implementa un sistema de almacenamiento de imágenes con:
Imagen personalizada:// Esquema de URI para acceder a imágenes individuales generadas
Cada recurso de imagen tiene un nombre basado en su solicitud, una descripción con fecha de creación y un tipo MIME de imagen/png.
Indicaciones
El servidor proporciona un único mensaje:
generate-image: Crea indicaciones para generar imágenes usando Stable Diffusion
Argumento opcional "estilo" para controlar el estilo de la imagen (realista/artístico/abstracto)
Genera una plantilla de solicitud con orientación específica de estilo.
Herramientas
El servidor implementa tres herramientas:
generate-image: genera una imagen utilizando el modelo de difusión estable de Replicate
Toma "prompt" como un argumento de cadena obligatorio
Los parámetros opcionales incluyen "negative_prompt", "width", "height", "num_inference_steps" y "guidance_scale".
Devuelve la imagen generada y su URL
save-image: guarda una imagen generada en el sistema de archivos local
Toma "image_url" y "prompt" como argumentos de cadena obligatorios
Genera una identificación única para la imagen y la guarda en el directorio "generated_images"
list-saved-images: enumera todas las imágenes guardadas
Devuelve una lista de todas las imágenes guardadas con sus metadatos y miniaturas.
Related MCP server: gemini-image-mcp
Configuración
Replicar token de API
Para utilizar este generador de imágenes, necesita un token de API de replicación:
Crea una cuenta en Replicate
Obtenga su token API desde https://replicate.com/account
Cree un archivo
.envbasado en la plantilla.env.exampleproporcionada:
REPLICATE_API_TOKEN=your_replicate_api_token_hereImportante: El archivo
.envse excluye del control de versiones mediante.gitignorepara evitar la exposición accidental de su token de API. Nunca envíe información confidencial a su repositorio.
Configuración del entorno
Clonar el repositorio:
git clone https://github.com/yourusername/image-generator.git
cd image-generatorCrear y activar un entorno virtual:
# Using venv
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activateInstalar dependencias:
pip install -r requirements.txtConfigure su archivo
.envcomo se describe arriba
Inicio rápido
Instalar
Escritorio de Claude
En MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json En Windows: %APPDATA%/Claude/claude_desktop_config.json
Uso
Una vez que el servidor esté en funcionamiento, puedes:
Genere una imagen utilizando la herramienta "generar imagen" con una indicación descriptiva
Guarde la imagen generada usando la herramienta "guardar imagen" con la URL de la imagen y el mensaje
Ver todas las imágenes guardadas usando la herramienta "lista-de-imágenes-guardadas"
Acceda a las imágenes guardadas a través de la lista de recursos
Desarrollo
Construcción y publicación
Para preparar el paquete para su distribución:
Sincronizar dependencias y actualizar el archivo de bloqueo:
uv syncDistribuciones de paquetes de compilación:
uv buildEsto creará distribuciones de origen y de rueda en el directorio dist/ .
Publicar en PyPI:
uv publishNota: Deberás configurar las credenciales de PyPI a través de variables de entorno o indicadores de comando:
Token:
--tokenoUV_PUBLISH_TOKENO nombre de usuario/contraseña:
--username/UV_PUBLISH_USERNAMEy--password/UV_PUBLISH_PASSWORD
Depuración
Dado que los servidores MCP se ejecutan en stdio, la depuración puede ser complicada. Para una experiencia óptima, recomendamos usar el Inspector MCP .
Puede iniciar el Inspector MCP a través de npm con este comando:
npx @modelcontextprotocol/inspector uv --directory B:\NEWTEST\image-generator run image-generatorAl iniciarse, el Inspector mostrará una URL a la que podrá acceder en su navegador para comenzar a depurar.
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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.1- First observed
generate-image - First observed
list-saved-images - First observed
save-image
TDQS
Scored across 3 tools
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
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.544MIT
- AlicenseBqualityCmaintenanceAn MCP server for image generation using the Gemini API.122 npm2MIT
- 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
- AlicenseBqualityDmaintenanceAn MCP server that generates pixel-art PNGs from text prompts, using a free image backend, and saves them directly to your project directory.2MIT