Nano Banana MCP Server
An MCP server for generating and editing images with Gemini: picks the model per request, renders up to 4K in any aspect ratio
- 402 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Prompts go to the Gemini API and spend the quota or money of your Google account
- The API key sits in the client configuration, and the server writes files to the output folder
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/nano-banana-mcp-serverDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Prompts go to the Gemini API and spend the quota or money of your Google account
- The API key sits in the client configuration, and the server writes files to the output folder
This is third-party code. Review the repository files before installing.
What it does
Nano Banana MCP Server gives an agent image generation on Gemini models. The agent calls generate_image, edit_image and upload_file: it creates a picture from a description, edits an existing one and uploads files through the Gemini Files API. The server saves results to disk, by default in ~/nanobanana-images. There are three models. Nano Banana 2, built on Gemini 3.1 Flash Image, is the default: resolution up to 4K, Google Search grounding, up to five characters and 14 objects in one scene, clean text rendering. Gemini 3 Pro Image takes complex compositions and accepts a configurable thinking level. Gemini 2.5 Flash Image remains for quick drafts up to 1024 pixels. In auto mode the server picks a model from the prompt text: words like "4K" or "professional" lead to Pro, while "quick" and "draft" lead to Nano Banana 2. Parameters include an aspect ratio from 1:1 to 21:9, resolution, thinking_level and the number of images n per call. For photography, design and editing the server ships prompt templates, which the agent sees as MCP resources.
Who it is for. For developers and designers who need images for sites, interfaces and social posts right inside a Claude Code, Cursor or Codex session.
Good fit when
- You need a cover or thumbnail in an exact format: aspect_ratio accepts 16:9, 9:16, 21:9, 1:1, 4:5 and more
- The image must carry readable text, such as a poster or a product card: Nano Banana 2 can place text precisely
- You want a series of variants in one call: the n parameter creates several images and numbers the files
- The project runs on Google Cloud and API keys are inconvenient: the server signs in through Vertex AI and application default credentials
- An existing picture needs a fix described in words, through edit_image
Not a fit when
- The agent works offline or in an air-gapped setup: every model is called through the Gemini API
- You need another provider such as Midjourney or OpenAI: the server supports Gemini models only
- You need video or animation: the server creates and edits images only
Example request
Make a 16:9 YouTube cover with the text "Launch on November 1" on a dark background and save it to the assets folderMCP
- Transport
- stdio
- Authentication
- API key
Environment variables
GEMINI_API_KEYrequired, secret- Gemini API key for key-based sign-in; not needed with Vertex AI
NANOBANANA_AUTH_METHOD- Sign-in method: api_key, vertex_ai or auto
NANOBANANA_MODEL- Default model: flash, nb2, pro or auto
IMAGE_OUTPUT_DIR- Image folder used when output_path is omitted
Limitations
You need a Gemini API key (GEMINI_API_KEY) or Vertex AI access in a Google Cloud project with the roles/aiplatform.user role. For Gemini 3 Pro Image and Nano Banana 2 on Vertex AI the region must be global; us-central1 fits only Gemini 2.5 Flash Image.
A relative output_path is resolved from the server process working directory. The IMAGE_OUTPUT_DIR variable applies only when output_path is omitted. Python 3.11 is needed for development only; running through uvx needs just uv installed.
Whether the Gemini API is reachable from Russia was not checked for this card.
How to disable. Remove the nanobanana entry from mcpServers in the Claude Desktop, Cursor or Continue configuration, or the mcp_servers.nanobanana section from Codex config.toml. Revoke the Gemini key in your Google account if needed. Saved images stay in ~/nanobanana-images.
FAQ
How do I connect Nano Banana MCP to Claude Code?
Add the server to the configuration: command uvx, args nanobanana-mcp-server@latest, and pass GEMINI_API_KEY in env. The same fields work for Cursor and Continue.dev. In Codex the entry goes into the mcp_servers section of config.toml, and codex mcp add can create it.
How does Nano Banana 2 differ from Pro in this server?
Nano Banana 2 is the default and takes 2–4 seconds per image at up to 4K. Pro takes 5–8 seconds but reasons deeper over a complex scene and supports thinking_level with LOW and HIGH. You can force a model with the model_tier parameter set to nb2, pro or flash.
How do I sign in through Google Cloud without an API key?
Set NANOBANANA_AUTH_METHOD=vertex_ai, GCP_PROJECT_ID and GCP_REGION=global. The Vertex AI API must be enabled in the project, and the service account needs the roles/aiplatform.user role. The auto value uses the key when present and falls back to Vertex AI when it is absent.
Where does the server save images?
The order is the output_path parameter, then the IMAGE_OUTPUT_DIR variable, then ~/nanobanana-images. A path ending in a slash counts as a directory, which the server creates and fills with generated names. With n above one, files get the suffixes _2, _3 and so on.
Does the server work with Gemini CLI and Open WebUI?
Yes, both have configuration examples. Gemini CLI and other generic clients start the server with uvx nanobanana-mcp-server@latest and read the key from the GEMINI_API_KEY environment variable. In Open WebUI the command and env go into the mcp_servers settings.
Discussion
No questions or reviews yet.
Related
MCP serversA CLI and Claude Code skill for Gemini images from 512 to 4K, with reference-based edits and transparent assets
Nano Banana Pro Prompts Recommend
AI Image Prompt Recommender
A skill that picks ready image-generation prompts from a large library, shows sample images and assembles a prompt for your text
An MCP server for generating images and video from the agent: several models, a large prompt library and parallel tasks
A Claude Code skill for generating, editing and reviewing images with Google Gemini models, with a plan and approval before every paid request
Over 1,400 popular prompts for NanoBanana and GPT Image from X posts ranked by likes, plus a system prompt that turns a short idea into a detailed one
A local MCP server for editing and analyzing images: the agent crops frames, finds objects and reads text from photos
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Nano Banana MCP Server (this entry) | no | API key | 402 | |
| Nano Banana 2 Skill | no | 416 | a CLI and skill for Gemini images without an MCP server | |
| MCP Kandinsky | yes | API key | 6 | an MCP server for generation through Sber's Kandinsky |
README in short
Ready configuration snippets cover Claude Desktop, Claude Code, Cursor, Codex, Continue.dev, Open WebUI and Gemini CLI. The two sign-in methods, API key and Vertex AI, are described separately, next to a model selection guide with example calls. The troubleshooting section covers a missing key, a failed server start and folder permissions for the images.