I Built an MCP Server to Fix Gemini Image Generation's Square-Only Limitation

SYS.BLOG

I Built an MCP Server to Fix Gemini Image Generation's Square-Only Limitation

Google's AntiGravity IDE can generate images via Gemini Nano Banana, but only square ones. I asked Claude Code to build an MCP server calling the Gemini image API directly, and it did it in one shot. Now I can generate landscape images from any IDE.

|Aditya Bawankule
MCPGeminiImage GenerationOpen SourceClaude Code

Google's AntiGravity IDE has a genuinely useful feature: the AI coding agent can generate images inline using Gemini Nano Banana, and you can drop them straight into your project. Great for websites, game sprites, UI assets, anything visual.

But there's a catch: it only outputs square images. That's a dealbreaker for most real projects. My website needs landscape thumbnails. Games need wide backgrounds. Square-only is a non-starter.


The Fix: One MCP Server, One Shot

Rather than waiting for Google to add aspect ratio support, I asked Claude Code to build an MCP server that calls the Gemini image generation API directly, with full control over dimensions.

It built it in one shot. A little research to confirm the right API surface, and it was done. The server exposes image generation as a tool that any MCP-compatible agent can call, which means it works across Claude Code, Claude Desktop, and any other IDE with MCP support, not just AntiGravity.


What It Does

  • Generate images at any aspect ratio (landscape, portrait, square)
  • Call it from any MCP-compatible IDE or agent
  • Get production-ready images without leaving your workflow

The image quality from Gemini's image generation is genuinely impressive: the usual AI artifacts show up occasionally, but the baseline quality is high enough that I'd call the results practically production-ready for many use cases.


Get It

Source code is on GitHub. If you're building a website or game and want quick, high-quality AI-generated images without leaving your editor, give it a try. And if you want your AI agent to manage project tasks too, check out AGINEAR, same MCP pattern, applied to project management.