Package Exports
- gemini-imagen4-mcp
- gemini-imagen4-mcp/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gemini-imagen4-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Gemini Imagen 4.0 MCP Server
A Model Context Protocol (MCP) server that provides image generation capabilities using Google's Imagen 4.0 models.
Features
- Generate high-quality images from text descriptions
- Support for multiple Imagen 4.0 model variants:
imagen-4.0-generate-preview-06-06(default)imagen-4.0-fast-generate-preview-06-06imagen-4.0-ultra-generate-preview-06-06
- Configurable aspect ratios (1:1, 3:4, 4:3, 9:16, 16:9)
- Multiple output formats (PNG, JPEG)
- Content filtering with detailed feedback
- Automatic file saving with timestamped filenames
Installation
npm install -g gemini-imagen4-mcpSetup
- Get a Gemini API key from Google AI Studio
- Set the environment variable:
export GEMINI_API_KEY="your-api-key-here"
Usage with Claude Desktop
Add this server to your Claude Desktop configuration:
{
"mcpServers": {
"gemini-imagen4": {
"command": "gemini-imagen4-mcp",
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}Available Tools
generate_image_from_text
Generate an image from a text description.
Parameters:
prompt(required): Text description of the image to generatemodel(optional): Imagen 4.0 model variant to useimagen-4.0-generate-preview-06-06(default)imagen-4.0-fast-generate-preview-06-06imagen-4.0-ultra-generate-preview-06-06
aspectRatio(optional): Aspect ratio of the generated image1:1,3:4,4:3,9:16,16:9
outputMimeType(optional): Output format (image/pngorimage/jpeg, default:image/png)
Example:
Generate an image of "a serene mountain lake at sunset with reflection"Generated images are automatically saved to a generated-images/ directory with timestamped filenames.
Development
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run devLicense
MIT