Image generation with Google Gemini 3.1 Flash: 512px-4K, reference images, search grounding
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.

MCP server for Google's Gemini 3.1 Flash Image β fast image generation with advanced reasoning, 512pxβ4K resolution, up to 14 reference images, Google Search grounding, and automatic thinking mode.
Add to your mcp config (mcp.json / .claude.json):
All generated images include invisible SynthID watermarks for authenticity and provenance tracking.
generate_app_icon forces a square, transparent, 1024px PNG every time β no way to get a non-square or opaque-background iconThis model is different. Unlike traditional image generators that rely solely on training data, Gemini 3.1 Flash has live access to Google Search and Image Search. It can find actual references for products, people, events, or anything that exists online. "Way of Wade 12" β generates the REAL shoe. "Tony Hawk" β finds real photos. Don't over-prompt β let the model cook.
Jensen Huang β GPU Surfing

Elon Musk β Mars Chess Match

Jensen Huang β GPU Kitchen

Elon Musk β Cybertruck Symphony

Jensen Huang β Underwater Data Center

Elon Musk β SpaceX Skateboarding

Current Weather in San Francisco

Butterfly on Flower

512px (fastest)

1K

2K

Using uvx (recommended β no install needed):
Note: Use
@latestto ensure uv always fetches the newest version from PyPI. Without it, uv may use a cached environment.
Using pip:
From source:
Config file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonmacOS
spawn uvx ENOENTerror: Use the full path β find it withwhich uvx, then set"command": "/Users/you/.local/bin/uvx".
Add to .cursor/mcp.json:
Images are saved to ~/gemini_images by default. Add "OUTPUT_DIR": "/your/path" to customize.
generate_imageGenerate an image with Gemini 3.1 Flash Image.
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | string | required | Text description. Less is more β "Tony Hawk kickflip" beats a long description. The model with search can find references automatically. |
aspect_ratio | string | 1:1 | One of: 1:1 1:4 1:8 2:3 3:2 3:4 4:1 4:3 4:5 5:4 8:1 9:16 16:9 21:9 |
image_size | string | 2K | 512px, 1K, 2K, or 4K |
output_format | string | png | png, jpeg, or webp |
reference_image_paths | list | [] | Up to 14 local image paths (10 objects + 4 characters) |
enable_google_search | bool | false | USE THIS for products, people, events β anything that exists now. The model searches Google for real info. |
enable_image_search | bool | false | USE THIS for visual references. The model finds actual images to work from. This is huge β it can reference real photos of anyone/anything. |
thinking_level | string | minimal | minimal (fast) or high (best quality) |
response_modalities | list | ["TEXT","IMAGE"] | ["TEXT","IMAGE"], ["IMAGE"], or ["TEXT"] |
transparent_background | bool | false | Produce a transparent PNG/WebP cut-out via the two-pass difference matte (~2x cost; see below) |
preserve_original | bool | true | Also keep the pass-1 (white-background) image, not just the cut-out |
alpha_output_format | string | png | Alpha-capable output format: png or webp |
Image size guide:
512px β fastest, lowest cost (0.5K)1K β fast, good for testing (~1-2 MB)2K β recommended for most use cases (~3-5 MB)4K β maximum quality for production assets (~8-15 MB)Just set transparent_background=true. You get back a ready-to-use transparent PNG/WebP (real alpha channel) at transparent_path β no manual masking, no second tool, no follow-up steps.
Generating an app icon or logo? Use the dedicated
generate_app_icontool instead β it forces square + transparent + 1024px PNG so the icon constraints can't be set wrong.
Under the hood this is a two-pass difference matte. The subject is rendered once on a pure white (#FFFFFF) background, that image is edited to a pure black (#000000) background, and the two frames are combined to solve for alpha per pixel: since obs_white β obs_black = (1βΞ±)Β·255 on every channel, Ξ± = 1 β mean(obs_white β obs_black)/255, and the foreground colour is un-premultiplied from the black frame. Because there's no colour key, there's no green spill/halo; alpha is fractional, so soft edges, glow, glass, and faint shadows all survive. Pillow-only, zero ML downloads β but it costs a second model call (~2x tokens/latency).
The technique assumes the edit pass changed only the background. If the model drifts the subject between passes, the matte degrades β the result still returns (aligned/alignment_error flag it, with a loud post_processing_warnings entry) so you can decide whether to regenerate.
Each returned image gains: transparent_path, background_removed, background_removal_mode ("difference_matte"), aligned, alignment_error, alpha_output_format, and post_processing_warnings. By default the pass-1 (white-background) original is preserved alongside the cut-out (preserve_original=true).
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/ultimate-gemini-mcp)<a href="https://allmcps.com/mcp/ultimate-gemini-mcp"><img src="https://allmcps.com/api/badge/ultimate-gemini-mcp?style=directory" alt="Ultimate Gemini MCP on AllMCPs" /></a>