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
| Name | What it is | Required |
|---|---|---|
GEMINI_API_KEY | Your Gemini API key | Yes |
IMAGE_OUTPUT_DIR | The image output directory | No |
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 promptedit_image: edit an existing imageupload_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
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
nano-banana-proHelps your agent generate new images or edit existing ones with Google's Gemini-based image model, at several resolutions.nano-banana-pro-openrouterHelps your agent create or edit images using AI. It can generate images from descriptions or modify existing ones.image-genLets your agent draw or generate a picture from a text description, using Google's Nano Banana image models on OpenRouter.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.