DALL-E 3 MCP Server
Supports loading environment variables from .env files for configuration, particularly for storing the OpenAI API key.
Runs on Node.js (version 18.0.0 or higher) as the runtime environment for the MCP server.
Enables the generation of high-quality images using OpenAI's DALL-E 3 model with support for different sizes, quality levels, and styles.
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., "@DALL-E 3 MCP Servergenerate a futuristic city skyline at sunset with flying cars"
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.
DALL-E 3 MCP Server
A Model Context Protocol (MCP) server that provides DALL-E 3 image generation capabilities. This server allows LLMs to generate high-quality images using OpenAI's DALL-E 3 model through the standardized MCP interface.
Features
π¨ High-Quality Image Generation: Uses DALL-E 3 for state-of-the-art image creation
π§ Flexible Configuration: Support for different sizes, quality levels, and styles
π Automatic File Management: Handles directory creation and file saving
π‘οΈ Robust Error Handling: Comprehensive error handling with detailed feedback
π Detailed Logging: Comprehensive logging for debugging and monitoring
π TypeScript: Fully typed for better development experience
π§ͺ Well Tested: Comprehensive test suite with high coverage
Related MCP server: OpenAI MCP
Installation
Using NPX (Recommended)
npx imagegen-mcp-d3Using NPM
npm install -g imagegen-mcp-d3From Source
git clone https://github.com/chrisurf/imagegen-mcp-d3.git
cd imagegen-mcp-d3
npm install
npm run build
npm startPrerequisites
Node.js: Version 18.0.0 or higher
OpenAI API Key: You need a valid OpenAI API key with DALL-E 3 access
Configuration
Environment Variables
Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY="your-openai-api-key-here"Or create a .env file in your project root:
OPENAI_API_KEY=your-openai-api-key-hereUsage
With Claude Desktop
Add this server to your Claude Desktop configuration:
{
"mcpServers": {
"imagegen-mcp-d3": {
"command": "npx",
"args": ["imagegen-mcp-d3"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here"
}
}
}
}With Other MCP Clients
The server implements the standard MCP protocol and can be used with any compatible client.
Available Tools
generate_image
Generates an image using DALL-E 3 and saves it to the specified location.
Parameters:
prompt(required): Text description of the image to generateoutput_path(required): Full file path where the image should be savedsize(optional): Image dimensions -"1024x1024","1024x1792", or"1792x1024"(default:"1024x1024")quality(optional): Image quality -"standard"or"hd"(default:"hd")style(optional): Image style -"vivid"or"natural"(default:"vivid")
Example:
{
"name": "generate_image",
"arguments": {
"prompt": "A serene sunset over a mountain lake with pine trees",
"output_path": "/Users/username/Pictures/sunset_lake.png",
"size": "1024x1792",
"quality": "hd",
"style": "natural"
}
}Response:
The tool returns detailed information about the generated image, including:
Original and revised prompts
Image URL
File save location
Image specifications
File size
API Reference
Image Sizes
Square:
1024x1024- Perfect for social media and general usePortrait:
1024x1792- Great for mobile wallpapers and vertical displaysLandscape:
1792x1024- Ideal for desktop wallpapers and horizontal displays
Quality Options
Standard: Faster generation, good quality
HD: Higher quality with more detail (recommended)
Style Options
Vivid: More dramatic and artistic interpretations
Natural: More realistic and natural-looking results
Development
Setup
git clone https://github.com/chrisurf/imagegen-mcp-d3.git
cd imagegen-mcp-d3
npm installAvailable Scripts
npm run dev # Run in development mode with hot reload
npm run build # Build for production
npm run start # Start the built server
npm run test # Run tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run format # Format code with Prettier
npm run typecheck # Run TypeScript type checkingProject Structure
src/
βββ index.ts # Main server implementation
βββ types.ts # TypeScript type definitions
βββ __tests__/ # Test files
βββ index.test.ts # Main test suiteRunning Tests
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode during development
npm run test:watchError Handling
The server provides comprehensive error handling for common scenarios:
Missing API Key: Clear error message when
OPENAI_API_KEYis not setInvalid Parameters: Validation errors for required and optional parameters
API Errors: Detailed error messages from the OpenAI API
File System Errors: Handling of directory creation and file writing issues
Network Errors: Graceful handling of network connectivity issues
Logging
The server provides detailed logging for monitoring and debugging:
Request initiation and parameters
API communication status
Image generation progress
File saving confirmation
Error details and stack traces
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Workflow
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-featureMake your changes
Add tests for new functionality
Ensure all tests pass:
npm testCommit your changes:
git commit -m 'Add amazing feature'Push to the branch:
git push origin feature/amazing-featureOpen a Pull Request
CI/CD
This project uses GitHub Actions for continuous integration and deployment:
Testing: Automated testing on multiple Node.js versions (18, 20, 22)
Code Quality: ESLint, Prettier, and TypeScript checks
Security: Dependency vulnerability scanning
Publishing: Automatic NPM publishing on release
Coverage: Local code coverage reporting
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Email: Open an issue for support
Changelog
See CHANGELOG.md for a detailed history of changes.
Related Projects
Model Context Protocol - The official MCP specification
MCP TypeScript SDK - TypeScript SDK for MCP
Claude Desktop - AI assistant that supports MCP servers
Acknowledgments
OpenAI for the DALL-E 3 API
Anthropic for the Model Context Protocol specification
The MCP community for tools and documentation High-performance MCP for generating images using DALLΒ·E 3 β optimized for fast, scalable, and customizable inference workflows.
Available Tools
1 toolgenerate_imageB
Generate an image using DALL-E 3
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Text prompt for image generation | |
| output_path | Yes | Full path where the image should be saved | |
| size | No | Image size | 1024x1024 |
| quality | No | Image quality | hd |
| style | No | Image style | vivid |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations present, so description should disclose behavioral traits like API dependency, cost, rate limits, or side effects. Only states 'using DALL-E 3' without elaboration. Fails to inform agent of external service implications.
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?
Single concise sentence that is front-loaded and contains no unnecessary words. Every word earns its place.
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 output schema and 5 parameters, the description fails to explain return behavior, error handling, or the effect of parameters like size/quality/style. Incomplete for a non-trivial generation tool.
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?
Input schema has 100% coverage with descriptions for all parameters. Description adds no additional parameter context beyond the schema, achieving baseline score.
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?
Description clearly states it generates an image using DALL-E 3, with a specific verb and resource. No siblings exist, so differentiation is not needed.
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 or alternatives. Since there are no siblings, lack of exclusion criteria is less critical, but still no usage context provided.
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.
1 tool update
- First observed
generate_image
TDQS
Scored across 1 tool
With only one tool, there is no risk of ambiguity; the tool's purpose is clear and distinct by default.
The single tool follows a clear verb_noun pattern (generate_image), and with only one tool, naming consistency is trivially maintained.
One tool feels thin for a server named 'DALL-E 3 MCP Server'. While the tool itself is non-trivial, the server would benefit from additional tools for variations or edits to be well-scoped.
The server only exposes image generation, missing other DALL-E 3 capabilities like editing or variations. This leaves notable gaps for agents expecting more comprehensive functionality.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoβ¦
Related MCP Servers
- FlicenseAqualityDmaintenanceAn MCP server that allows users to generate, edit, and create variations of images through OpenAI's DALL-E API, supporting both DALL-E 2 and DALL-E 3 models.49-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server enabling AI assistants to generate images through OpenAI's DALL-E API with full support for all available options and fine-grained control.13 npm1MIT
- AlicenseDqualityDmaintenanceA Model Context Protocol server that provides image generation capabilities using Google's Gemini 2 API, allowing users to generate multiple images with customizable parameters like prompts, aspect ratios, and person generation settings.159 npm5MIT
- AlicenseDqualityFmaintenanceA Model Context Protocol server that enables generating and editing images using OpenAI's gpt-image-1 model, allowing AI assistants to create and modify images from text prompts.282 npm18MIT