Universal Image Generator MCP Server
Multi-provider AI image generation server for MCP clients. Generate high-quality images using Google Gemini, ZHIPU AI CogView-4, or Alibaba Bailian through any MCP-compatible application.
Features
- Multi-Provider Support: Choose between Gemini, ZhipuAI, or Bailian
- Image Generation: Text-to-image for all providers
- Image Transformation: Edit existing images (Gemini & Bailian only)
- Smart Language Optimization: Automatic prompt translation and optimization
- Local Storage: Save generated images to your specified directory
Quick Setup
1. Install via uvx
No manual installation required! The server will be automatically downloaded and run.
2. Get API Keys
Choose one provider and get an API key:
- Gemini: Google AI Studio
- ZhipuAI: ZHIPU AI Platform
- Bailian: Alibaba DashScope
3. Configure MCP Client
Add to your MCP client configuration (e.g., claude_desktop_config.json):
{
"mcpServers": {
"universal-image-generator": {
"command": "uvx",
"args": [
"universal-image-generator-mcp"
],
"env": {
"IMAGE_PROVIDER": "zhipuai",
"ZHIPU_API_KEY": "your-api-key-here",
"GEMINI_API_KEY": "your-api-key-here",
"DASHSCOPE_API_KEY": "your-api-key-here",
"OUTPUT_IMAGE_PATH": "/path/to/save/images"
}
}
}
}
Environment Variables:
IMAGE_PROVIDER:"gemini","zhipuai", or"bailian"- Set the corresponding API key for your chosen provider
OUTPUT_IMAGE_PATH: Directory to save generated images (optional)
Available Tools
generate_image_from_text
Create images from text descriptions.
generate_image_from_text(prompt: str) -> str
transform_image_from_encoded (Gemini & Bailian only)
Transform images using base64-encoded image data.
transform_image_from_encoded(encoded_image: str, prompt: str) -> str
transform_image_from_file (Gemini & Bailian only)
Transform existing image files.
transform_image_from_file(image_file_path: str, prompt: str) -> str
Usage Examples
Once configured, ask your AI assistant:
- "Generate an image of a sunset over mountains"
- "Create a 3D rendered flying pig in a sci-fi city"
- "Transform this image by adding snow to the scene"
Generated images are saved to your configured output directory.
Example Output
Prompt: "Create a 3D rendered image of a pig with wings and a top hat flying over a futuristic sci-fi city with lots of greenery"
Transform: "Add a cute baby whale flying alongside the pig"
Provider Capabilities
| Provider | Generation | Transformation | Language Optimization |
|---|---|---|---|
| Gemini | ✅ | ✅ | English prompts |
| ZhipuAI | ✅ | ❌ | Chinese prompts |
| Bailian | ✅ | ✅ | Chinese prompts |
Development
Test the server locally:
git clone https://github.com/ECNU3D/universal-image-generator-mcp.git
cd universal-image-generator-mcp
fastmcp dev src/universal_image_generator_mcp/server.py
Visit http://localhost:5173/ to use the MCP Inspector for testing.
License
MIT License
Metadata
Release files for universal-image-generator-mcp 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| universal_image_generator_mcp-0.1.2.tar.gz | 3.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| universal_image_generator_mcp-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.2 MB
Release files / universal_image_generator_mcp-0.1.2.tar.gz
| Download URL | universal_image_generator_mcp-0.1.2.tar.gz |
|---|---|
| Size | 3.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cf92206e29ab2758f0a0a7850acb82fdb5f8f84d714e54fa279f6b710cc22c3
|
|
BLAKE2b-256 checksum How to use checksums |
b0449feb13f132d08b550d0299f0eccf2c0933b5a71fa0560a921595c4dd8bfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.4
|
Release files / universal_image_generator_mcp-0.1.2-py3-none-any.whl
| Download URL | universal_image_generator_mcp-0.1.2-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c2a79c9d7c765d6c57a14372da90749fe72b082b7510c1b5750f654c87c2a4d
|
|
BLAKE2b-256 checksum How to use checksums |
0635c42ff0dca139b99f0adb58f3a2f8ef4eeddb33a55dca7845801b84528514
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.4
|