Universal Image Generator MCP Server
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., "@Universal Image Generator MCP Server generate an image of a sunset over mountains with a lake"
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.
Universal Image Generator MCP Server
This project is a fork and rewrite of the original: https://github.com/qhdrl12/mcp-server-gemini-image-generator repo.
Multi-provider AI image generation server for MCP clients. Generate high-quality images using Google (Imagen & Gemini), ZHIPU AI CogView-4, or Alibaba Bailian through any MCP-compatible application.
Features
Multi-Provider Support: Choose between Google (Imagen/Gemini), ZhipuAI, or Bailian
Image Generation: Text-to-image for all providers
Image Transformation: Edit existing images (Google & Bailian only)
Smart Language Optimization: Automatic prompt translation and optimization
Local Storage: Save generated images to your specified directory
Related MCP server: universal-image-mcp
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:
Google: Google AI Studio (supports both Imagen and Gemini models)
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": "google",
"GOOGLE_MODEL": "gemini",
"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:"google","zhipuai", or"bailian"GOOGLE_MODEL:"gemini"or"imagen"(only for Google provider, defaults to "gemini")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, model_type: Optional[str] = None) -> strParameters:
prompt: Text description of the image to generatemodel_type: Optional model selection for Google provider ("gemini"or"imagen")Only applies to Google provider
If not specified, uses
GOOGLE_MODELenvironment variable (defaults to "gemini")
transform_image_from_encoded (Google & Bailian only)
Transform images using base64-encoded image data.
transform_image_from_encoded(encoded_image: str, prompt: str) -> strtransform_image_from_file (Google & Bailian only)
Transform existing image files.
transform_image_from_file(image_file_path: str, prompt: str) -> strUsage 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 | Models | Generation | Transformation | Language Optimization |
Imagen, Gemini | ✅ | ✅ (Gemini only) | English prompts | |
ZhipuAI | CogView-4 | ✅ | ❌ | Chinese prompts |
Bailian | WanX-2.1 | ✅ | ✅ | Chinese prompts |
Note: For Google provider, image transformation is only supported with Gemini models. Imagen is for generation only.
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.pyVisit http://localhost:5173/ to use the MCP Inspector for testing.
License
MIT License
Available Tools
4 toolsgenerate_image_from_textA
Generate an image based on the given text prompt using the configured image provider.
Args:
prompt: User's text prompt describing the desired image to generate
model_type: Optional model type for Google provider ("gemini" or "imagen").
If not specified, uses the default from GOOGLE_MODEL env var.
Returns:
Path to the generated image file using the configured provider's image generation capabilities
Inputs: prompt (required), model_type. Returns: result
transform_image_from_encodedA
Transform an existing image based on the given text prompt using the configured image provider.
Args:
encoded_image: Base64 encoded image data with header. Must be in format:
"data:image/[format];base64,[data]"
Where [format] can be: png, jpeg, jpg, gif, webp, etc.
prompt: Text prompt describing the desired transformation or modifications
Returns:
Path to the transformed image file saved on the server
Inputs: encoded_image (required), prompt (required). Returns: result
transform_image_from_fileA
Transform an existing image file based on the given text prompt using the configured image provider.
Args:
image_file_path: Path to the image file to be transformed
prompt: Text prompt describing the desired transformation or modifications
Returns:
Path to the transformed image file saved on the server
Inputs: image_file_path (required), prompt (required). Returns: result
transform_image_from_urlB
Transform an existing image from a URL using the configured image provider.
Args:
image_url: Remote or Public URL of the image to be transformed
prompt: Text prompt describing the desired transformation or modifications
function: WanX editing function (default: 'description_edit'). Supported functions:
'description_edit', 'description_edit_with_mask', 'stylization_all',
'stylization_local', 'remove_watermark', 'expand', 'super_resolution',
'colorization', 'doodle', 'control_cartoon_feature'
mask_image_url: URL of mask image (required for 'description_edit_with_mask')
Returns:
Details about the transformed image including local path and remote URL
Inputs: image_url (required), prompt (required), function, mask_image_url. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no ambiguity. 'generate_image_from_text' creates new images from scratch, while the three 'transform_image_from_*' tools all modify existing images but differ in their input sources (encoded data, local file, URL). The descriptions clearly differentiate these input methods, preventing misselection.
All four tools follow a perfect verb_object_from_source pattern: 'generate_image_from_text', 'transform_image_from_encoded', 'transform_image_from_file', and 'transform_image_from_url'. This consistent naming convention makes the tool purposes immediately understandable and predictable.
Four tools is reasonable for an image generation/transformation server, though slightly minimal. The set covers core functionality well, but could potentially benefit from additional utilities like image analysis or format conversion tools. The count is appropriate for the basic scope presented.
The tool surface covers the essential workflows for image generation and transformation comprehensively. It provides multiple input methods for transformations (encoded, file, URL) which is thorough. A minor gap exists in not having a dedicated tool for pure image analysis or metadata extraction, but the core functionality is well-covered.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
Generate images with any major model — one API key, one prepaid balance, one MCP.
Generate images, video, audio and short films with 140+ AI models from any MCP client.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Related MCP Servers
- AlicenseBqualityFmaintenanceA remote MCP image generation server that unifies OpenAI Images and Gemini generateContent APIs with preset-based configuration for multi-provider support.6MIT
- AlicenseAqualityDmaintenanceMCP server for multi-provider AI image generation (AWS Bedrock, OpenAI, Google Gemini) enabling image generation, transformation, and editing through a unified interface.41MIT
- AlicenseAqualityDmaintenanceA multi-provider MCP server that enables AI agents to generate and edit images across OpenAI, Google Gemini, Azure, Vertex, and OpenRouter with a unified API.317Apache 2.0
- AlicenseAqualityDmaintenanceMCP server for AI image generation supporting multiple providers (OpenRouter, Together AI, Replicate, fal.ai) and compatible with various MCP agents.263 npm1MIT