Provides access to FLUX.1-Kontext-pro model for creative illustrations and flexible image generation through Azure AI Foundry
Enables AI-powered image generation through Azure OpenAI's DALL-E 3 model for photorealistic images, portraits, and artistic content with customizable quality and style settings
Azure Image Generation MCP
Model Context Protocol (MCP) server for AI-powered image generation using Azure DALL-E 3 and FLUX models
🎨 Overview
A powerful MCP server that brings professional AI image generation to LibreChat. Generate stunning images using Azure's DALL-E 3 for photorealistic content or FLUX for creative artwork, with intelligent automatic model selection based on your prompts.
Perfect for LibreChat users who want seamless image generation capabilities powered by Azure AI Foundry models.
✨ Features
🤖 Dual Model Support
DALL-E 3: Photorealistic images, portraits, and artistic content
FLUX (FLUX.1-Kontext-pro): Creative illustrations and flexible generation
🧠 Intelligent Model Selection
Automatic model selection based on prompt analysis
FLUX as default for optimal results
DALL-E 3 when explicitly requested or optimal
📐 Multiple Image Sizes
Square (1024x1024) - Perfect for social media
Wide (1792x1024) - Great for banners and headers
Tall (1024x1792) - Ideal for posters and vertical content
⚙️ Customization Options
Quality settings (standard/HD) for DALL-E 3
Style options (vivid/natural) for DALL-E 3
Fast generation times (typically 30-60 seconds)
🔌 Easy Integration
Works seamlessly with LibreChat
Compatible with MCP clients
Simple configuration via environment variables
📋 Prerequisites
Node.js >= 18.0.0
Azure OpenAI API access with:
DALL-E 3 deployment (optional)
FLUX deployment (FLUX.1-Kontext-pro)
LibreChat instance (for LibreChat integration)
🚀 Installation
Option 1: NPM Installation (Recommended)
Option 2: From Source
Option 3: NPX (No Installation)
⚙️ Configuration
1. Environment Variables
Create a .env
file or set environment variables:
2. LibreChat Integration
Add to your librechat.yaml
:
📖 Usage
In LibreChat
Simply ask the AI to generate an image:
Model Selection
Automatic (Default): The system intelligently chooses between DALL-E 3 and FLUX
FLUX (Default): Used for most requests unless DALL-E is explicitly mentioned
DALL-E 3: Explicitly request by mentioning "DALL-E" in your prompt
Advanced Options
Specify additional parameters in your request:
🔧 Docker Deployment (LibreChat)
If using Docker with LibreChat, add to your Dockerfile:
Then ensure your docker-compose.yml
includes the environment variables:
🛠️ API Reference
Tool: generate_image
Generates an AI image based on a text prompt.
Parameters
Parameter | Type | Required | Default | Description |
| string | Yes | - | Description of the image to generate |
| string | No |
| Model selection:
,
, or
|
| string | No |
| Image dimensions:
,
,
|
| string | No |
| DALL-E style:
or
|
| string | No |
| DALL-E quality:
or
|
Response
Returns a structured response with:
Text description of the generated image
Base64-encoded PNG image data
Metadata (model used, size, generation time)
🐛 Troubleshooting
Common Issues
Images not displaying in Azure models:
Ensure you're using LibreChat with the MCP image rendering fix (included in LibreChat v0.7.9+)
Check that your
librechat.yaml
configuration is correct
MCP server fails to start:
Verify environment variables are set correctly
Check that Node.js version is >= 18.0.0
Ensure
@modelcontextprotocol/sdk
is installed
API errors:
Verify your Azure API key is valid
Check that the base URL points to your Azure OpenAI endpoint
Ensure your Azure deployment has DALL-E 3 or FLUX enabled
Generation timeout:
Increase
timeout
value inlibrechat.yaml
(default: 180000ms)Check your network connectivity to Azure
Debug Mode
Enable debug logging by checking LibreChat logs:
📝 Example Prompts
Photorealistic Images
Artistic & Creative
Marketing & Design
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature
)Commit your changes (
git commit -m 'Add some AmazingFeature'
)Push to the branch (
git push origin feature/AmazingFeature
)Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
Built for LibreChat - Open-source ChatGPT alternative
Uses Model Context Protocol (MCP) by Anthropic
Powered by Azure AI Foundry models
📬 Support
Issues: GitHub Issues
LibreChat Discord: Join the community
Documentation: LibreChat Docs
Made with ❤️ for the LibreChat community
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Enables AI-powered image generation using Azure DALL-E 3 and FLUX models with intelligent automatic model selection. Generates stunning photorealistic or creative images directly within LibreChat through simple text prompts.