Open Google Image Generator MCP
Allows interaction with Google Cloud Vertex AI, providing tools for image generation, editing, analysis, background removal, upscaling, and more via Imagen and Gemini models.
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., "@Open Google Image Generator MCP generate an image of a cat wearing a hat"
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.
Open Google Image Generator MCP
This project is a Model Context Protocol (MCP) server that exposes Google Cloud Vertex AI and Google GenAI SDK capabilities—Gemini (Nano Banana) image models, Gemini 3.x / 4 text models, Veo, Lyria, and Gemini TTS—to MCP-compatible clients. Built with the MCP Python SDK (FastMCP on mcp 1.x, MCPServer on mcp 2.x — both supported).
Current version: 3.3.0 — Image generation migrated from the shut-down Imagen 4 to the Gemini image family (
gemini-3.1-flash-lite-image,gemini-3.1-flash-image,gemini-nano-banana-2.1,gemini-3-pro-image) served from the Vertex AIglobalendpoint; Gemini 3.8 Flash / 4 Argon text models; Gemini 3.8 TTS with all 30 prebuilt voices; Lyria 3.5;mcp2.x compatibility.
Features & Tools
Image Tools
Tool | Description | Backend |
| Text-to-image generation. Supports aspect ratio, multiple images, and WebP/AVIF output. Negative prompt / seed / watermark / GCS output apply to legacy Imagen IDs only | Gemini image ( |
| Mask-guided inpaint/outpaint, background swap, product image, and prompt-driven edit (mask is sent to Gemini as a reference image). See Edit modes below | Gemini image ( |
| Free-form | Gemini image ( |
| Multimodal image understanding and Q&A. Supports | Gemini ( |
| Upscale to | Gemini image ( |
| Remove the background and save a transparent PNG. Optional | Gemini image + local chroma key ⁴ |
| Parallel batch text-to-image generation (up to 10 prompts, max 4 concurrent). All tiers supported | Gemini image |
| Sequential multi-step image processing pipeline (generate → edit → transform → …) | Mixed |
⁴ These three tools used Imagen until v3.3.0. As of 2026-10-16 every Imagen model (
imagen-3.0-capability-001,imagen-4.0-*,imagen-4.0-upscale-preview) returns HTTP 404 on Vertex AI in us-central1, us-west1, us-east4, europe-west4 and global (and Imagen 4 was shut down on the Gemini API on 2026-08-17), so they now run on Gemini image models. Gemini cannot emit an alpha channel, sotool_remove_backgroundasks the model to paint everything except the subject in a flat chroma-key colour and keys it out locally with Pillow. Gemini edits are instruction-guided, not pixel-exact: content outside the mask is preserved closely but not bit-for-bit. Legacyimagen-*IDs are still accepted asmodel_name.
Video Tools
Tool | Description | Backend |
| Text-to-video generation. Supports | Veo ( |
| Animate a still image into video. Supports optional | Veo ⁵ |
| Extend an existing video clip by 4, 6, or 8 seconds | Veo ⁵ |
| Insert or remove an object in a video via | Veo ⁵ |
| Video understanding and Q&A (max 20MB; mp4, mov, avi, webm, mkv) | Gemini GenAI SDK |
⁵ The four Veo tools are still placeholder stubs: they validate input and write a text placeholder to the output path instead of calling Veo. Note that Veo 3.1 is served from
us-central1andglobalbut returns 404 in other regions such asus-west1.
Audio Tools
Tool | Description | Backend |
| Text-to-speech with any of the 30 prebuilt Gemini voices (Kore, Puck, Zephyr, Charon, Aoede, …). Supports | Gemini TTS ( |
| Music generation from a text prompt | Lyria 3.5 / Lyria 3 (GenAI SDK) |
GenAI SDK Tools
Tool | Description | Backend |
| Text embeddings as float vectors | Gemini Embedding ( |
| Streaming text generation — response is accumulated and returned in full | Gemini ( |
Utility Tools
Tool | Description |
| Live-probes every candidate model in the configured project (Gemini models on |
| Register a local file for use as a reference image in subsequent tool calls (e.g. |
Edit modes (tool_edit_image)
| What it does | Mask required? |
| Prompt-driven full-image edit, no mask | No |
| Add an object into the masked region | Yes |
| Remove content in the masked region | Yes |
| Extend the image beyond its original bounds | Yes |
| Swap the background | No |
| Product reference styling | No |
All modes work with the Gemini image models (default gemini-3.1-flash-image; use gemini-3-pro-image for the most faithful edits). tool_edit_image also accepts model_tier.
When to use which "image + text → image" tool
Need | Use |
Mask-guided inpaint/outpaint/BG-swap, or a specific edit mode |
|
"Make it look like X" / style transfer / scene rewriting / multi-reference compositions |
|
Model tiers
Most tools accept a model_tier parameter:
Tier | Description |
| Lowest latency, lowest cost |
| Quality / speed trade-off |
| Higher quality, moderate latency |
| Maximum quality (Nano Banana Pro / Veo quality models) |
Model resolution by tier and tool
Tier |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tool_edit_image and tool_remove_background use the same tier mapping. tool_upscale_image needs 2K/4K output, so its fast/balanced tiers use gemini-3.1-flash-image (the lite model is 1K-only); quality → gemini-nano-banana-2.1, ultra → gemini-3-pro-image. tool_run_pipeline applies the same per-tool mappings.
GenAI SDK tools (tool_live_generate, tool_analyze_video, tool_generate_speech, tool_embed):
Tier |
|
|
|
|
|
|
|
|
| — | — |
|
|
| — |
¹
gemini-4-argonhas no Gemini API free tier (quota limit 0) — it needs a billed key or Vertex AI. ²gemini-embedding-2is used with a Gemini API key;gemini-embedding-001with Vertex AI ADC.Model IDs verified on 2026-10-16 against both catalogs.
gemini-2.5-pro/flash/flash-literetire on Vertex AI on 2026-10-20 and are no longer used as defaults.
Model availability: Vertex AI vs. Gemini API
Google exposes models through two separate endpoints with different model catalogs:
Endpoint | Auth | Image models | Text/speech models |
Vertex AI ( | ADC / Service Account |
|
|
Gemini API ( |
| same Gemini image family | same text/TTS models plus |
³ The Gemini 3.x image models (
gemini-3-pro-image,gemini-3.1-flash-lite-image,gemini-nano-banana-2.1) are served by Vertex AI only from thegloballocation — verified on 2026-10-16: they return HTTP 404 fromus-west1and HTTP 400 (exists) fromglobal. The same holds forgemini-4-argon,gemini-3.8-flash,gemini-3.5-flash(-lite),gemini-3.1-flash-liteand the 3.8 TTS models. This server therefore sends every Gemini:generateContentcall toGOOGLE_CLOUD_GEMINI_LOCATION(defaultglobal), and keeps Imagen/Veo onGOOGLE_CLOUD_LOCATION.Sources:
Gemini API model catalog: https://ai.google.dev/gemini-api/docs/models.md.txt
Gemini API deprecations: https://ai.google.dev/gemini-api/docs/deprecations
Vertex AI model catalog: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/google-models.md.txt
Vertex AI model versions & retirements: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-versions
Vertex AI available models (live probe): run
tool_list_available_modelsin your project
Output formats
tool_generate_image, tool_edit_image, tool_transform_image, and tool_upscale_image accept a save_format / output_format parameter:
Format | Notes |
| Lossless |
| Smaller files, lossy. |
| Modern lossless/lossy, wide browser support |
| Best compression, requires |
Error handling
All tools return a uniform error shape:
{
"success": false,
"error": {
"code": 404,
"model": "gemini-9.9-nonexistent",
"endpoint": ":generateContent",
"message": "Publisher Model `...` is not found.",
"hint": "Model '...' not found in project '...' / location '...'. Try: gemini-3.1-flash-image.",
"docs_url": "https://docs.cloud.google.com/...",
"log_path": ".../logs/vertex_ai_mcp.log",
"duration_s": 0.42
}
}HTTP code | What you'll see in |
400 | Vertex's parameter-validation message verbatim |
401 | "Run |
403 | IAM role hint ( |
404 | Live alternatives from the probe cache ( |
429 |
|
500/502/503/504 | "Safe to retry once" |
| After 90s — suggests a |
| Client-side validation failure (mask missing, file not found, etc.); no HTTP call is made |
Full request/response logs are written to logs/vertex_ai_mcp.log.
Resources & Prompts
Local Resources (
local://outputs/{filename}): Generated and processed media files are exposed as MCP resources for seamless display in MCP clients (Claude Desktop, Cursor, etc.).Pre-built Prompts: Includes specialized prompt templates for
character_design,logo_concept, andUI_UX_mockup.
Related MCP server: nano-banana-mcp
Prerequisites & Resources
Python 3.10 or newer
Google Cloud Account with an active project
Vertex AI API enabled in your project
Google Cloud CLI (
gcloud) installed and configured
For GenAI SDK tools (tool_embed, tool_analyze_video, tool_generate_speech, tool_live_generate, tool_generate_music), you additionally need one of:
A Cloud API Key (
GOOGLE_CLOUD_API_KEY) — created in GCP Console, uses your existing GCP billing. Enables newer models likegemini-3.5-flash. (Recommended)A Gemini API key (
GOOGLE_GENAI_API_KEY) — from AI Studio, separate billing.Vertex AI ADC — set
GOOGLE_GENAI_BACKEND=vertexai, usesgcloud auth application-default login.Service Account JSON (
GOOGLE_APPLICATION_CREDENTIALS) — see below.
Cloud API Key setup: Run
gcloud services enable generativelanguage.googleapis.com apikeys.googleapis.comthengcloud services api-keys create --display-name="GeminiKey". The key string appears in the command output — copy it directly to.env.
Installation & Setup
Option A: Install from PyPI
pip install open-google-image-generator-mcpOption B: Clone the Repository
git clone https://github.com/miracorhan/OpenGoogleImageGeneratorMCP.git
cd OpenGoogleImageGeneratorMCP
pip install -r requirements.txtAuthentication
Choose one of the following methods:
Option A — User account (interactive login):
gcloud auth application-default loginOpens a browser. Use an account that has access to your Google Cloud project.
Option B — Service Account JSON key:
# Download key: GCP Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON
# Required role: Vertex AI User (roles/aiplatform.user)Set in .env:
GOOGLE_APPLICATION_CREDENTIALS=C:\path\to\service-account-key.jsonBoth vertex_ai_tools (Imagen, Veo, Lyria) and genai_tools (embed, speech, video analysis, live) pick up the SA JSON automatically. No gcloud CLI required when using a service account key.
Environment Configuration
Create a .env file in the project root:
# Required
GOOGLE_CLOUD_PROJECT=your-google-cloud-project-id
GOOGLE_CLOUD_LOCATION=us-central1
# Optional: location for Gemini :generateContent calls (Gemini 3.x image/text
# models are served from `global` only). Imagen/Veo keep GOOGLE_CLOUD_LOCATION.
# GOOGLE_CLOUD_GEMINI_LOCATION=global
# Output directory for generated media
DEFAULT_OUTPUT_DIR=./outputs
# --- GenAI SDK (for embed, speech, live, music, video-analysis tools) ---
# Option A: Cloud API Key (recommended — uses GCP billing, enables gemini-3.5-flash)
# Create: gcloud services enable generativelanguage.googleapis.com apikeys.googleapis.com
# gcloud services api-keys create --display-name="GeminiKey"
GOOGLE_CLOUD_API_KEY=AIza...
# Option B: Gemini API key (AI Studio, separate billing, free tier available)
# GOOGLE_GENAI_BACKEND=gemini_api
# GOOGLE_GENAI_API_KEY=AIza...
# Option C: Vertex AI ADC (no key needed, uses gcloud auth application-default login)
# GOOGLE_GENAI_BACKEND=vertexai
# Option D: Service Account JSON key (no gcloud CLI required)
# Download: GCP Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON
# Required role: Vertex AI User (roles/aiplatform.user)
# GOOGLE_APPLICATION_CREDENTIALS=C:\path\to\service-account-key.json
# --- Advanced Vertex AI Authentication (Optional) ---
# Direct OAuth 2.0 Access Token
# GOOGLE_ACCESS_TOKEN=ya29.a0AfB_by...
# Service Account Impersonation
# IMPERSONATE_SERVICE_ACCOUNT=your-service-account@your-project.iam.gserviceaccount.comUsage
Running as a Standalone Script
python mcp_server.pyIntegrating with MCP Clients
For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"OpenGoogleImageGenerator": {
"command": "python",
"args": ["/absolute/path/to/OpenGoogleImageGeneratorMCP/mcp_server.py"],
"env": {
"GOOGLE_CLOUD_PROJECT": "your-google-cloud-project-id",
"GOOGLE_CLOUD_LOCATION": "us-central1",
"GOOGLE_GENAI_API_KEY": "AIza..."
}
}
}
}Replace /absolute/path/to/your/... with the actual path, and use the correct Python executable if using a virtual environment.
Example prompts
"Generate an image of a futuristic city at sunset."
"Edit this banner — add a glowing cyan halo around the logo." (
tool_edit_image,EDIT_MODE_DEFAULT)"Transform this photo into a hand-drawn pencil sketch." (
tool_transform_image)"Remove the background from the image I just generated."
"Analyze this image and tell me what objects are present."
"Generate 8 product shots in parallel with different backgrounds." (
tool_batch_generate)"Run a pipeline: generate → remove background → upscale." (
tool_run_pipeline)"Convert this text to speech using the Kore voice." (
tool_generate_speech)"Generate a 30-second ambient music track." (
tool_generate_music)"Embed this sentence for semantic search." (
tool_embed)"Animate this product photo into a 5-second video." (
tool_image_to_video)"Generate a video of a sunset with audio." (
tool_generate_video,audio_enabled=true)
Troubleshooting
Symptom | Cause | Fix |
| ADC token expired |
|
| Same ADC expiry, probe skipped | Re-authenticate (above) |
| Service account missing role | Grant |
| Wrong path in | Use an absolute path; forward slashes or escaped backslashes |
| Key used with Vertex AI endpoint (rejects keys) | Ensure |
|
|
|
| Google's key-validation error is identical whether the key is dead or | Confirm with |
|
|
|
| The TTS-preview, live-preview, and embedding-preview models used by these tools are not published to the Vertex AI publisher catalog — Vertex AI/ADC is not a usable fallback for them, unlike image models | Use |
Worried a GenAI SDK call will charge your Cloud Billing / free-trial credit | Once billing is enabled on a project, the Gemini API free tier is gone entirely for that project — every call becomes billable from the first token, and some promotional/free-trial credits explicitly exclude Gemini API usage regardless | For risk-free testing, create a separate GCP project with no billing account attached at all and generate its AI Studio key there ( |
Edited |
| Reconnect the MCP server ( |
|
| Omit |
| These models are served from the | Leave |
| Imagen 4 has been shut down (Gemini API: 2026-08-17) | Use |
| These models only accept | Handled automatically by |
| The model has no Gemini API free tier | Use a billed key, Vertex AI, or a lower tier ( |
| Server older than v3.3.0 installed with | Update the server (v3.3.0 supports both |
| Model not available in your project/region | Run |
| Wrong command prefix | Use |
Security: The Cloud API Key string appears in plaintext in
gcloud services api-keys createoutput. Copy it directly to.env— never paste it into a chat, commit, or log. Revoke a leaked key immediately withgcloud services api-keys delete KEY_ID.
Author & License
Developer: Mirac Orhan (mirac.orhan@gmail.com)
License: MIT License (Open Source — Free for everyone to use, modify, and distribute)
Available Tools
19 toolstool_analyze_imageC
Analyze an image using a multimodal prompt with Vertex AI.
Inputs: params (required).
tool_analyze_videoB
Analyze a local video file using Gemini Vision. Supports mp4, mov, avi, webm, mkv. Max 20MB inline.
Inputs: params (required).
tool_batch_generateA
Generate images for multiple prompts in a single call (max 10, max 4 concurrent).
Inputs: params (required).
tool_edit_imageA
Image editing via Gemini image models — mask-guided inpaint/outpaint, background swap, product image, or mask-free prompt-driven edit. For free-form natural-language transforms (style transfer, scene rewriting), use tool_transform_image instead.
Inputs: params (required).
tool_embedC
Generate a float embedding vector for the given text using Gemini Embedding.
Inputs: params (required).
tool_extend_videoC
Extend an existing video by generating additional seconds at the end.
Inputs: params (required).
tool_generate_imageA
Generate an image from a text prompt using Vertex AI Gemini image models (Nano Banana). Use model_tier for simple model selection: fast/balanced/quality/ultra. negative_prompt / seed / watermark / safety / storage_uri apply to legacy Imagen models only.
Inputs: params (required).
tool_generate_musicB
Generate music from a text prompt using Lyria. Check tool_list_available_models to verify Lyria is enabled in your project.
Inputs: params (required).
tool_generate_speechB
Convert text to speech using Gemini TTS. Returns a WAV file path in outputs/.
Inputs: params (required).
tool_generate_videoC
Generate a video from a text prompt using Veo.
Inputs: params (required).
tool_image_to_videoC
Generate a video from a still image as the first frame using Veo.
Inputs: params (required).
tool_list_available_modelsA
Live-probe every candidate Vertex AI publisher model in this project/location and return only those that respond (HTTP 200 or 400 = reachable; 404 = not found and excluded). Results are cached for the server process lifetime; pass force_refresh=true to rescan.
Returns: { "available": { "image_generation": [...], "image_transformation": [...], "text": [...], "vision": [...] }, "recommended": <static list, may include models that 404 in this project>, "checked_at": , "project": ..., "location": ... }
Inputs: force_refresh.
tool_live_generateC
Generate text using Gemini streaming. The full streamed response is accumulated and returned.
Inputs: params (required).
tool_remove_backgroundB
Remove the background from an image and save a transparent PNG. The Gemini model places the subject on a flat chroma-key colour, which is then keyed out locally.
Inputs: params (required).
tool_run_pipelineB
Chain image processing steps sequentially. Each step's output becomes the next step's input. Supported tools: generate, edit, transform, upscale, remove_background. Example: generate → remove_background → upscale.
Inputs: params (required).
tool_transform_imageA
Free-form 'image + text -> image' transformation via Gemini multimodal models. Use for style transfer, scene rewriting, or any natural-language image edit that does not require pixel-precise masking.
Inputs: params (required).
tool_upload_fileA
Register a local file for use as a reference image in other tools (e.g. tool_transform_image). Returns a file_uri to pass as additional_image_paths.
Inputs: params (required).
tool_upscale_imageB
Upscale a low resolution image to 2K or 4K by re-rendering it with a Gemini image model.
Inputs: params (required).
tool_video_object_editC
Insert or remove an object in a video using Veo.
Inputs: params (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Most tools target clearly distinct resource/action pairs across image, video, audio, and text. However, tool_edit_image and tool_transform_image overlap: edit_image mentions 'mask-free prompt-driven edit' while transform_image is for free-form natural-language transforms, so the boundary between them is slightly blurry despite the descriptions attempting to redirect.
All 19 tools use the same tool_ prefix with snake_case verb_noun or verb_noun_phrase pattern, e.g. tool_generate_image, tool_remove_background, tool_run_pipeline. No mixed conventions or inconsistent verb styles.
19 tools is on the heavy side for a single MCP server, even accounting for the broad multimodal scope. Some tools, such as batch_generate and run_pipeline, are convenience wrappers that an agent could orchestrate by calling individual generation tools, making the surface feel somewhat inflated.
The surface covers generation, editing, transformation, upscaling, background removal, video create/extend/edit/analyze, music, speech, text, embeddings, model discovery, batch, and pipeline. Minor gaps include no explicit output management/history tool and no non-streaming text generation, but core multi-modal workflows are well covered.
Maintenance
Related MCP Connectors
MCP server for Google Veo AI video generation
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
Generate AI images and videos from any compatible MCP client.
MCP server for Qwen Image 3 AI image generation
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP server for generating images and videos using Google Gemini and VEO models, with support for multiple AI models and credential modes.108 PyPI1Apache 2.0

nano-banana-mcpofficial
AlicenseAqualityDmaintenanceMCP server that generates images using Gemini 3 Pro Image on Vertex AI, with support for reference images, task management, and GCS integration.21,729 npm10-- AlicenseAqualityCmaintenanceMCP server for Google Gemini image generation with configurable model support, enabling text-to-image generation, image editing, and iterative refinement.640MIT
- FlicenseAqualityDmaintenanceWraps Google Gemini's image generation API as an MCP server, enabling text-to-image, image editing, and grounded search workflows from any MCP client.2-