Gemini-Imagen4
Generates images from text descriptions using Google's Imagen 4.0 models with support for multiple model variants (standard, fast, ultra), flexible aspect ratios, and configurable output formats (PNG, JPEG).
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., "@Gemini-Imagen4create a photo of a futuristic city at night with flying cars"
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.
🎨 Gemini-Imagen4
Local AI Image Generation MCP Server powered by Google's Imagen 4.0 models
Generate stunning images from text descriptions using Google's cutting-edge Imagen 4.0 models through the Model Context Protocol (MCP). Images are saved locally to ./generated-images/ directory.
✨ Features
🖼️ High-quality image generation using Google's latest Imagen 4.0 models
⚡ Multiple model variants for different speed/quality needs
🎯 Flexible aspect ratios (1:1, 3:4, 4:3, 9:16, 16:9)
📸 Multiple output formats (PNG, JPEG)
🔒 Built-in safety filtering with reason reporting
💾 Local file storage - images saved to
./generated-images/directory🚀 Easy local setup - run with npx or npm
🔌 MCP Resources - browse generated images via MCP protocol
Related MCP server: MCP Image Gen
🚀 Quick Start
Prerequisites
Node.js 18+
Google Gemini API key (Get one here)
Installation & Usage
Option 1: Install from npm (Recommended)
npm install -g gemini-imagen4Then run:
gemini-imagen4Option 2: Run directly with npx
npx gemini-imagen4Option 3: Clone and run locally
git clone https://github.com/chug2k/gemini-imagen4.git
cd gemini-imagen4
npm install
npm run devYou'll be prompted to enter your Gemini API key when you first run it.
Usage
Once running, the server provides:
Tool: generate_image_from_text
Generate images from text descriptions with optional customization.
Parameters:
prompt(required): Text description of the image to generatemodel(optional): Choose from:imagen-4.0-generate-preview-06-06(default - balanced)imagen-4.0-fast-generate-preview-06-06(faster generation)imagen-4.0-ultra-generate-preview-06-06(highest quality)
aspectRatio(optional):1:1,3:4,4:3,9:16, or16:9outputMimeType(optional):image/png(default) orimage/jpeg
Example:
{
"prompt": "A majestic dragon soaring through a sunset sky",
"model": "imagen-4.0-ultra-generate-preview-06-06",
"aspectRatio": "16:9",
"outputMimeType": "image/png"
}Response:
Images are saved to ./generated-images/ with timestamped filenames like 1754998591_majestic_dragon_soaring.png
Resource: generated-images
Browse the generated images directory via MCP resources protocol.
🔌 Adding to Claude Desktop
To use this server with Claude Desktop, add it to your MCP configuration:
Edit your claude_desktop_config.json:
{
"mcpServers": {
"gemini-imagen4": {
"command": "npx",
"args": ["gemini-imagen4"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}Replace your-api-key-here with your actual Gemini API key, then restart Claude Desktop.
🔧 Configuration
The server requires a Gemini API key and supports the following configuration:
# smithery.yaml
runtime: typescript
startCommand:
type: http
configSchema:
type: object
required: ["geminiApiKey"]
properties:
geminiApiKey:
type: string
title: "Gemini API Key"
description: "Your Google Gemini API key"
modelName:
type: string
title: "Model Name"
description: "Default Imagen model to use"
default: "imagen-4.0-generate-preview-06-06"
enum:
- "imagen-4.0-generate-preview-06-06"
- "imagen-4.0-fast-generate-preview-06-06"
- "imagen-4.0-ultra-generate-preview-06-06"🏃♂️ Development
Run the development server:
npm run dev📦 Model Variants
Standard (
imagen-4.0-generate-preview-06-06): Best balance of quality and speedFast (
imagen-4.0-fast-generate-preview-06-06): Optimized for quick generationUltra (
imagen-4.0-ultra-generate-preview-06-06): Maximum quality output
🛡️ Safety & Content Filtering
All images are processed through Google's built-in safety filters. If content is filtered, the tool will return the reason for filtering instead of an image.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
MIT License - see LICENSE file for details.
🔗 Links
Built with ❤️ using Google's Imagen 4.0 and the Model Context Protocol
This server cannot be deployed
Maintenance
Related MCP Connectors
Create images and videos from prompts, with options for image mixing, reference images, and start/…
Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.
AI image generation across 5 quality tiers (SDXL to Gemini 3 Pro), 50 free credits on signup.
AI image + video generation for agents: --flag prompt DSL, async generate/poll, x402 pay-per-use.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to generate high-quality images using Google's Gemini and Imagen models with support for multiple aspect ratios, dynamic model selection, and direct file saving capabilities.MIT
- AlicenseNot gradedqualityBmaintenanceGenerates images from text prompts using Google's Gemini AI models with customizable aspect ratios and resolutions up to 4K, automatically saving images locally.37 npm2MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables high-quality image generation using Google's Imagen 4 Ultra model through Replicate, with automatic local download and organized file management. Supports multiple aspect ratios, output formats, and configurable safety filtering.1-
- AlicenseNot gradedqualityNot gradedmaintenanceEnables high-quality image generation using Google's Imagen 4 Ultra model via the FAL AI platform, featuring automatic local file downloads and batch processing. It supports various aspect ratios and offers both real-time and asynchronous generation methods through the Model Context Protocol.-