DALL-E MCP Server
Servidor DALL-E MCP
Un servidor MCP (Protocolo de contexto de modelo) para generar imágenes utilizando la API DALL-E de OpenAI.
Características
Generar imágenes utilizando DALL-E 2 o DALL-E 3
Editar imágenes existentes (solo DALL-E 2)
Crear variaciones de imágenes existentes (solo DALL-E 2)
Validar la clave API de OpenAI
Related MCP server: GPT Image MCP Server
Instalación
# Clone the repository
git clone https://github.com/Garoth/dalle-mcp.git
cd dalle-mcp
# Install dependencies
npm install
# Build the project
npm run buildNota importante para los usuarios de Cline
Al usar este servidor DALL-E MCP con Cline, se recomienda guardar las imágenes generadas en el directorio de su espacio de trabajo actual. Para ello, configure el parámetro saveDir para que coincida con dicho directorio. Esto garantiza que Cline pueda localizar y mostrar correctamente las imágenes generadas en su conversación.
Ejemplo de uso con Cline:
{
"prompt": "A tropical beach at sunset",
"saveDir": "/path/to/current/workspace"
}Uso
Ejecución del servidor
# Run the server
node build/index.jsConfiguración para Cline
Agregue el servidor dall-e a su archivo de configuración de Cline MCP dentro de la configuración de VSCode (por ejemplo, ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):
{
"mcpServers": {
"dalle-mcp": {
"command": "node",
"args": ["/path/to/dalle-mcp-server/build/index.js"],
"env": {
"OPENAI_API_KEY": "your-api-key-here",
"SAVE_DIR": "/path/to/save/directory"
},
"disabled": false,
"autoApprove": []
}
}
}Asegúrese de:
Reemplace
/path/to/dalle-mcp-server/build/index.jscon la ruta real al archivo index.js creadoReemplace
your-api-key-herecon su clave API de OpenAI
Herramientas disponibles
generar_imagen
Genere una imagen usando DALL-E basándose en una indicación de texto.
{
"prompt": "A futuristic city with flying cars and neon lights",
"model": "dall-e-3",
"size": "1024x1024",
"quality": "standard",
"style": "vivid",
"n": 1,
"saveDir": "/path/to/save/directory",
"fileName": "futuristic-city"
}Parámetros:
prompt(obligatorio): descripción de texto de la imagen deseadamodel(opcional): modelo DALL-E a utilizar ("dall-e-2" o "dall-e-3", predeterminado: "dall-e-3")size(opcional): Tamaño de la imagen generada (predeterminado: "1024x1024")DALL-E 3: "1024x1024", "1792x1024" o "1024x1792"
DALL-E 2: "256x256", "512x512" o "1024x1024"
quality(opcional): Calidad de la imagen generada, solo DALL-E 3 ("estándar" o "hd", predeterminado: "estándar")style(opcional): Estilo de la imagen generada, solo DALL-E 3 ("vívido" o "natural", predeterminado: "vívido")n(opcional): Número de imágenes a generar (1-10, predeterminado: 1)saveDir(opcional): Directorio donde se guardan las imágenes generadas (predeterminado: directorio actual o SAVE_DIR de .env). Para usuarios de Cline: Se recomienda configurarlo con el directorio actual de su espacio de trabajo para una correcta visualización de las imágenes.fileName(opcional): nombre de archivo base para las imágenes generadas sin extensión (predeterminado: "dalle-{timestamp}")
editar_imagen
Edite una imagen existente utilizando DALL-E basándose en una indicación de texto.
⚠️ Problema conocido (18 de marzo de 2025): La API de edición de imágenes de DALL-E 2 presenta un error que, en ocasiones, ignora la solicitud y devuelve la imagen original sin modificaciones, incluso al usar imágenes y máscaras con el formato RGBA correcto. Este problema se ha reportado en el foro de la comunidad de OpenAI . Si experimenta este problema, pruebe con la herramienta
create_variation, que parece funcionar con mayor fiabilidad.
{
"prompt": "Add a red hat",
"imagePath": "/path/to/image.png",
"mask": "/path/to/mask.png",
"model": "dall-e-2",
"size": "1024x1024",
"n": 1,
"saveDir": "/path/to/save/directory",
"fileName": "edited-image"
}Parámetros:
prompt(obligatorio): descripción textual de las ediciones deseadasimagePath(obligatorio): Ruta a la imagen a editarmask(opcional): Ruta a la imagen de la máscara (se editarán las áreas blancas, se conservarán las áreas negras)model(opcional): modelo DALL-E a utilizar (actualmente solo "dall-e-2" admite la edición, predeterminado: "dall-e-2")size(opcional): Tamaño de la imagen generada (predeterminado: "1024x1024")n(opcional): Número de imágenes a generar (1-10, predeterminado: 1)saveDir(opcional): Directorio donde guardar las imágenes editadas (predeterminado: directorio actual o SAVE_DIR de .env). Para usuarios de Cline: Se recomienda configurarlo con el directorio actual de su espacio de trabajo para una correcta visualización de las imágenes.fileName(opcional): nombre de archivo base para las imágenes editadas sin extensión (predeterminado: "dalle-edit-{timestamp}")
crear_variación
Cree variaciones de una imagen existente utilizando DALL-E.
{
"imagePath": "/path/to/image.png",
"model": "dall-e-2",
"size": "1024x1024",
"n": 4,
"saveDir": "/path/to/save/directory",
"fileName": "image-variation"
}Parámetros:
imagePath(obligatorio): Ruta a la imagen para crear variaciones demodel(opcional): modelo DALL-E a utilizar (actualmente solo "dall-e-2" admite variaciones, predeterminado: "dall-e-2")size(opcional): Tamaño de la imagen generada (predeterminado: "1024x1024")n(opcional): Número de variaciones a generar (1-10, predeterminado: 1)saveDir(opcional): Directorio donde guardar las imágenes de variación (predeterminado: directorio actual o SAVE_DIR de .env). Para usuarios de Cline: Se recomienda configurarlo con el directorio actual de su espacio de trabajo para una correcta visualización de las imágenes.fileName(opcional): nombre de archivo base para las imágenes de variación sin extensión (predeterminado: "dalle-variation-{timestamp}")
validar_clave
Validar la clave API de OpenAI.
{}No se requieren parámetros.
Desarrollo
Configuración de prueba
Nota: La siguiente configuración .env SÓLO es necesaria para ejecutar pruebas, no para el funcionamiento normal.
Si está desarrollando o ejecutando pruebas para este proyecto, cree un archivo .env en el directorio raíz con su clave API de OpenAI:
# Required for TESTS ONLY: OpenAI API Key
OPENAI_API_KEY=your-api-key-here
# Optional: Default save directory for test images
# If not specified, images will be saved to the current directory
# SAVE_DIR=/path/to/save/directoryPara un funcionamiento normal con Cline, configure su clave API en el JSON de configuración de MCP como se describe en la sección "Agregar a la configuración de MCP" más arriba.
Puede obtener su clave API desde la página de claves API de OpenAI .
Ejecución de pruebas
# Run basic tests
npm test
# Run all tests including edit and variation tests
npm run test:all
# Run tests in watch mode
npm run test:watch
# Run specific test by name
npm run test:name "should validate API key"Nota: Las pruebas utilizan llamadas API reales y pueden generar cargos en su cuenta OpenAI.
Generación de imágenes de prueba
El proyecto incluye un script para generar imágenes de prueba para desarrollo y pruebas:
# Generate a test image in the assets directory
npm run generate-test-imageEsto creará una imagen de prueba simple en el directorio assets que puede usarse para probar las funciones de edición y variación.
Licencia
Instituto Tecnológico de Massachusetts (MIT)
Available Tools
4 toolscreate_variationC
Create variations of an existing image using DALL-E
| Name | Required | Description | Default |
|---|---|---|---|
| imagePath | Yes | Path to the image to create variations of | |
| model | No | DALL-E model to use (currently only dall-e-2 supports variations) | |
| size | No | Size of the generated image | |
| n | No | Number of variations to generate (1-10) | |
| saveDir | No | Directory to save the variation images | |
| fileName | No | Base filename for the variation images (without extension) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. While 'create variations' implies a generative operation, the description doesn't mention important behavioral aspects like whether this is a read-only operation, what permissions are needed, rate limits, cost implications, or what happens to the original image. For a tool with 6 parameters and no annotation coverage, this is a significant gap.
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, efficient sentence that states the core purpose without any wasted words. It's appropriately sized for the tool's complexity and gets straight to the point with no unnecessary elaboration.
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?
For a generative AI tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns (e.g., image paths, URLs, error handling), doesn't mention DALL-E API constraints or costs, and provides no guidance on usage context. The 100% schema coverage helps with parameters, but other critical contextual information is missing.
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?
The description mentions 'variations of an existing image' which provides context for the 'imagePath' parameter, but doesn't add meaningful semantic information beyond what's already in the schema (which has 100% coverage). The schema descriptions comprehensively document each parameter's purpose, constraints, and enums, so the description adds minimal value here.
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 action ('create variations') and resource ('existing image using DALL-E'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'edit_image' or 'generate_image', but the focus on variations of existing images provides some implicit distinction.
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 alternatives like 'edit_image' or 'generate_image'. There's no mention of prerequisites, constraints, or typical use cases, leaving the agent with no contextual usage information beyond the basic purpose.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
edit_imageC
Edit an existing image using DALL-E based on a text prompt
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Text description of the desired edits | |
| imagePath | Yes | Path to the image to edit | |
| mask | No | Path to the mask image (white areas will be edited, black areas preserved) | |
| model | No | DALL-E model to use (currently only dall-e-2 supports editing) | |
| size | No | Size of the generated image | |
| n | No | Number of images to generate (1-10) | |
| saveDir | No | Directory to save the edited images | |
| fileName | No | Base filename for the edited images (without extension) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool edits images using DALL-E but omits critical details: whether this is a read/write operation (implied mutation from 'edit'), authentication needs, rate limits, file format requirements, or what happens to the original image. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior and constraints.
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, efficient sentence that front-loads the core action ('Edit an existing image') and includes essential details (technology and input). There is zero waste or redundancy, making it appropriately sized and well-structured for quick comprehension.
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 (8 parameters, mutation operation, no output schema, and no annotations), the description is incomplete. It lacks information on behavioral traits (e.g., file handling, error cases), output format (what is returned?), and usage context. For a DALL-E editing tool with multiple parameters, this minimal description fails to provide sufficient context for effective agent use.
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 100%, so the schema fully documents all 8 parameters. The description adds no parameter-specific information beyond implying 'prompt' is used for editing. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate with additional semantic context for parameters.
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 ('Edit') and resource ('an existing image'), specifying the technology ('using DALL-E') and input mechanism ('based on a text prompt'). It distinguishes from sibling 'create_variation' and 'generate_image' by focusing on editing existing images rather than creating new ones or variations, though it doesn't explicitly contrast with these alternatives.
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 alternatives like 'create_variation' or 'generate_image'. It doesn't mention prerequisites (e.g., needing an existing image file), exclusions, or specific contexts where editing is preferred over generation. Usage is implied through the action 'edit an existing image' but lacks explicit direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageC
Generate an image using DALL-E based on a text prompt
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Text description of the desired image | |
| model | No | DALL-E model to use (dall-e-2 or dall-e-3) | |
| size | No | Size of the generated image | |
| quality | No | Quality of the generated image (dall-e-3 only) | |
| style | No | Style of the generated image (dall-e-3 only) | |
| n | No | Number of images to generate (1-10) | |
| saveDir | No | Directory to save the generated images | |
| fileName | No | Base filename for the generated images (without extension) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the basic function but omits critical behavioral details: whether this is a read-only or mutation operation, rate limits, authentication requirements, cost implications, or what happens when images are saved to 'saveDir'. For a complex 8-parameter tool with no annotation coverage, this is insufficient.
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, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for the tool's complexity and front-loads the essential information.
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?
For a complex image generation tool with 8 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns (image URLs? file paths? metadata?), error conditions, or behavioral constraints. The agent would need to guess about the output format and operational characteristics.
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 100%, so the schema fully documents all 8 parameters. The description adds no additional parameter information beyond what's in the schema, meeting the baseline expectation but not providing extra value. The description doesn't explain relationships between parameters (e.g., 'quality' and 'style' only apply to 'dall-e-3').
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 action ('generate') and resource ('image using DALL-E based on a text prompt'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'create_variation' or 'edit_image', which likely also involve image generation/manipulation.
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 alternatives like 'create_variation' or 'edit_image'. It doesn't mention prerequisites, constraints, or typical use cases, leaving the agent to infer usage from the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
validate_keyB
Validate the OpenAI API key
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but provides no information about what validation entails, what happens during validation, whether it makes external API calls, what the response format might be, or any error conditions. This leaves significant behavioral gaps.
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, efficient sentence that states exactly what the tool does with zero wasted words. It's appropriately sized for a simple validation tool and front-loads the core functionality immediately.
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?
For a validation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what validation means in this context, what constitutes success/failure, what information is returned, or how the validation is performed. The agent lacks crucial context to understand the tool's behavior and output.
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?
The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description doesn't need to compensate for any parameter gaps, and it correctly doesn't mention any parameters. Baseline for 0 parameters with full coverage is 4.
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 action ('validate') and the resource ('OpenAI API key'), providing specific verb+resource pairing. However, it doesn't differentiate from sibling tools (which are image-related operations), though this isn't necessary since they serve completely different domains.
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 alternatives. There's no mention of prerequisites, context for validation, or what constitutes appropriate usage scenarios. The agent must infer usage from the tool name alone.
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.
4 tool updates
- First observed
create_variation - First observed
edit_image - First observed
generate_image - First observed
validate_key
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: create_variation modifies an existing image, edit_image alters an image with a prompt, generate_image creates from scratch, and validate_key handles API authentication. There is no overlap in functionality, making tool selection straightforward for an agent.
All tool names follow a consistent verb_noun pattern (e.g., create_variation, edit_image, generate_image, validate_key) using snake_case throughout. This predictability enhances readability and usability for agents.
With 4 tools, this server is well-scoped for DALL-E image generation and management. Each tool serves a specific, essential function without bloat, making the set efficient and focused on core operations.
The tools cover key DALL-E operations: generation, editing, and variation creation, plus API key validation. A minor gap is the lack of tools for listing or managing generated images, but core workflows are fully supported without dead ends.
Maintenance
Related MCP Connectors
MCP server for NanoBanana AI image generation and editing
MCP server for Midjourney AI image generation and editing
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn MCP tool server that enables generating and editing images through OpenAI's image models, supporting text-to-image generation and advanced image editing (inpainting, outpainting) across various MCP-compatible clients.115MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that enables text-to-image generation and editing using OpenAI's gpt-image-1 model, supporting multiple output formats, quality settings, and background options.70-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables image generation and editing using OpenAI's DALL-E models with support for text prompts, inpainting, and outpainting. It includes advanced features like automatic aspect ratio mapping and intelligent file management to handle large image payloads.29 npm1MIT
- FlicenseAqualityDmaintenanceAn MCP server for generating and editing images using OpenAI's GPT Image and DALL·E models. It provides tools for image generation, editing, variation creation, and model listing with support for multiple AI models.24-