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
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
):
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.
Parameters:
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_MODEL
environment variable (defaults to "gemini")
transform_image_from_encoded
(Google & Bailian only)
Transform images using base64-encoded image data.
transform_image_from_file
(Google & Bailian only)
Transform existing image files.
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 | 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:
Visit http://localhost:5173/ to use the MCP Inspector for testing.
License
MIT License
This server cannot be installed
A multi-provider AI image generation server that allows users to create and transform images using Google (Imagen & Gemini), ZHIPU AI CogView-4, or Alibaba Bailian through any MCP-compatible application.
Related MCP Servers
- -securityAlicense-qualityA server that provides AI-powered image generation, modification, and processing capabilities through the Model Context Protocol, leveraging Google Gemini models and other image services.Last updated -11PythonMIT License
- -securityAlicense-qualityAn MCP tool server that enables generating and editing images through OpenAI's image models, supporting text-to-image generation and advanced image editing (inpainting, outpainting) across various MCP-compatible clients.Last updated -52TypeScriptMIT License
- -securityAlicense-qualityA universal AI server that provides image and video processing tools (background removal, upscaling, vectorization, etc.) for any MCP-compatible client with simple setup.Last updated -TypeScriptMIT License
- AsecurityAlicenseAqualityAn MCP server that enables AI applications to access 20+ model providers (including OpenAI, Anthropic, Google) through a unified interface for text and image generation.Last updated -210PythonMIT License