Imagen

Provides image generation for AI assistants using Gemini and Imagen models with flexible aspect ratios and secure API key handling.
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "vipincr-imagen-mcp": {
      "command": "python",
      "args": [
        "/absolute/path/to/imagen-mcp/run_server.py"
      ],
      "env": {
        "GOOGLE_AI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You can run a lightweight, Python-based MCP Server that enables AI assistants to generate images using Gemini and Imagen models. It exposes a set of practical tools for model selection, image generation, resizing, and format conversion, all accessible through any MCP-compatible client. Use it to build image-generation capabilities into your apps, bots, or editors with secure API key handling and flexible output options.

How to use

You interact with the Imagen MCP Server through an MCP client. Start the server in your environment and connect your client by configuring a local or remote MCP entry pointing to the server. Choose a model, then request image generation with a text prompt, optionally including references or resizing parameters. Retrieve the generated image as a base64 string or save it directly to your filesystem. Use the available tools to check status, list models, switch models, generate images from prompts, reuse reference images, resize outputs, and convert formats.

How to install

Prerequisites: Python 3.9 or newer, and a Google AI API key. Install Python dependencies from the requirements file, and ensure command-line access to Python is available.

# 1) Install Python dependencies
pip install -r requirements.txt

# 2) Start the server (example invocation)
python run_server.py

Configuration and usage notes

Key configuration and usage considerations include setting your Google AI API key as an environment variable or in a .env file, selecting a default image model, and choosing preferred aspect ratios. The server supports multiple aspect ratios such as 1:1, 16:9, 9:16, and others. If a chosen model does not support a specific aspect ratio, the server will retry without the aspect ratio constraint.

Security and troubleshooting

Protect your Google AI API key by keeping it out of version control. Prefer environment variables or secure secret storage in your MCP client configuration. If you encounter connectivity issues, verify that Python is on your PATH and that the server is reachable at the configured entry. For model-related problems, list available models and ensure you have access to the image generation capabilities associated with your API key.

Notes on integration

You can integrate the server with various MCP clients, such as Claude Desktop or VS Code, by configuring an MCP entry that runs the server locally or through a container/isolated environment. The server exposes a rich set of tools for image generation, reference-based creation, resizing, saving, and format conversion that you can call from your client workflows.

Available tools

check_api_status

Verify that your API key is configured and working.

list_image_models

Discover available image generation models for your API key.

set_image_model

Select which model to use for image generation.

get_current_image_model

Check which model is currently selected.

generate_image_from_prompt

Generate an image from a text description.

generate_image_with_references_from_files

Generate an image using 1–3 reference images plus a text prompt.

generate_image_with_references_resized_from_files

Generate with references then resize to target bounds.

generate_and_save_image

Generate an image and save to a file in one operation.

generate_and_save_image_resized

Generate, resize, and save to a file.

save_image_to_file

Save a base64-encoded image to a file.

generate_and_save_image_with_references

Generate with references and save in one step.

generate_and_save_image_with_references_resized

Generate with references, resize, and save.

generate_image_resized_from_prompt

Generate an image and resize it to fit within given dimensions.

convert_image

Convert image formats and create favicons when needed.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational