Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”‘ Needs an API keyDesign and media

Nano Banana MCP Server

Lets your AI agent generate and edit images with Google Gemini models, with aspect ratio and up to 4K output.

403 stars on GitHubby zhongweiliLicense MITUpdated last month

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add nanobanana -e GEMINI_API_KEY="<your value>" -- uvx nanobanana-mcp-server

What to fill in

NameWhat it isRequired
GEMINI_API_KEYYour Gemini API keyYes
IMAGE_OUTPUT_DIRThe image output directoryNo

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Make a square Instagram post image about coffee.
Generate a 16:9 YouTube thumbnail for a cooking video.

What it is

This server connects your agent to Google's Gemini image models. It picks a model for each request: Nano Banana 2 by default, Pro for harder scenes, or the older Flash model for quick drafts. You can set the aspect ratio, the output path and use prompt templates.

What it can do

  • generate_image: create images from a prompt
  • edit_image: edit an existing image
  • upload_file: upload files through the Gemini Files API
  • Model choice: nb2, pro or flash, or automatic
  • Aspect ratios such as 1:1, 16:9, 9:16 and 21:9
  • Prompt templates for photography, design and editing

When to use

  • β€ΊWhen you need a social media image or YouTube thumbnail in a given aspect ratio.
  • β€ΊWhen you want a product photo or a picture with clear text in it.
  • β€ΊWhen you want to edit an image you already have by describing the change.

What you need

A Google Gemini API key, or Google Cloud Vertex AI credentials. Run it with uvx or pip install (Python 3.11 or newer for development).

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free?

The server is open source. It needs a Gemini API key, which the readme says you can get free; usage of the Gemini API is billed by Google under its own terms.

What do I need?

A GEMINI_API_KEY, or Vertex AI with a GCP project and region.

Which models does it use?

Gemini 3.1 Flash Image (default), Gemini 3 Pro Image and Gemini 2.5 Flash Image.

How big can images be?

Up to 4K (3840px) with the NB2 and Pro models. The legacy Flash model goes up to 1024px.

Can I choose where files are saved?

Yes, with the output_path parameter, using a file path or a directory.

Which clients work?

Claude Desktop, Claude Code, Cursor, Codex, Continue.dev, Open WebUI and other MCP clients.

If it does not work

  • β€ΊCheck that GEMINI_API_KEY is set in the env section of your config.
  • β€ΊFor Vertex AI, set GCP_REGION to global for the Gemini 3 models and enable the Vertex AI API.
  • β€ΊRestart your MCP client after you edit the config, and check that uv is installed if you use uvx.

5 new skills a week. 1 minute to read.