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.
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
Installation
Using NPX (Recommended)
Using NPM
From Source
Prerequisites
- 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:
Or create a .env
file in your project root:
Usage
With Claude Desktop
Add this server to your Claude Desktop configuration:
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:
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 use - Portrait:
1024x1792
- Great for mobile wallpapers and vertical displays - Landscape:
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
Available Scripts
Project Structure
Running Tests
Error Handling
The server provides comprehensive error handling for common scenarios:
- Missing API Key: Clear error message when
OPENAI_API_KEY
is not set - Invalid 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-feature
- Make your changes
- Add tests for new functionality
- Ensure all tests pass:
npm test
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open 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.
This server cannot be installed
A Model Context Protocol server that provides OpenAI's DALL-E 3 image generation capabilities, allowing LLMs to generate high-quality images through a standardized interface.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that provides an image generation tool using Templated.io, allowing users to create customized images based on templates with text and image layers.Last updated -TypeScript
- -securityFlicense-qualityAn 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.Last updated -2TypeScript
- -securityAlicense-qualityA 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.Last updated -141JavaScriptMIT License
- -security-license-qualityA TypeScript-based MCP server that lets users generate images using OpenAI's dall-e-3 model by providing a prompt and image name.Last updated -1