Prerequisites
- A Google AI Studio account with an API key
- Billing or quota enabled for Gemini image and/or Imagen models on your key
- For edit/compose: source images as base64 (data URL prefixes accepted)
- project_contributor access in AgentRuntime
Connect in AgentRuntime
1
Get a Google AI Studio API key
Create a key at aistudio.google.com/apikey. Enable the image models you plan to use.
2
Create a connection
Go to Connections and click New custom connection to create an API key connection with
APIKey. Set DefaultModel (e.g. gemini-2.5-flash-image) if desired.3
Add geminiimage MCP instance
Go to MCP, click Add instance for geminiimage, wire your connection on Instance config, set the profile active, and save.
4
Generate a test image
Run mcp_call →
gemini_text_to_image with a simple prompt to verify model access.gemini_edit_image and gemini_compose_images require Gemini image models. Imagen models (imagen-4-*, imagen-3-*) support text-to-image via predict but not edit/compose handlers.What you can build
- Brand assets —
gemini_text_to_imagewith Imagen aspect ratios for ads and social formats. - Photo retouching — Product photo base64 →
gemini_edit_imagewith “remove background” or style prompts. - Collage generation — Multiple reference images →
gemini_compose_imageswith layout instructions. - Multimodal reports — LLM writes caption → image tool → append to Google Slides or Docs.
Tools
Example
Generate a square marketing image with Imagen:Configuration
Troubleshooting
Related
- Integrations quickstart
- OpenAI Images connector — alternative image generation
- Connector catalog
- Troubleshooting