Nano-Banana MCP Server
One-line summary: An MCP server for generating and iteratively editing AI images with Google Gemini, usable from Claude Code, Cursor, and other MCP clients.
Generate brand-new images from text prompts (
generate_image), choosing among five Gemini models (default Nano Banana 2.1).Edit a specific existing image file with a prompt, optionally supplying extra reference images for style transfer or added elements (
edit_image).Continue refining the last image generated or edited in the session for iterative improvements (
continue_editing).Control output shape and size via
aspectRatio,preset(web,phone,webconf,banner,square), andimageSize(512px–4K).Adjust reasoning effort with
thinkingLeveland enable Google Search groundity for fact-aware images (useGoogleSearch).Configure the Gemini API key (
configure_gemini_token) and check whether it is set (get_configuration_status).Inspect metadata about the most recent image (
get_last_image_info).
Provides tools for AI image generation and editing using Google Gemini models, including creating images from text prompts, modifying existing images with optional reference images, and iteratively continuing edits on the last generated image.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Nano-Banana MCP Server Generate an image of a red panda surfing at sunset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Nano-Banana MCP Server
An MCP server for AI image generation and editing using Google Gemini. Works with Claude Code, Cursor, and other MCP clients.
Independent project, forked from ConechoAI/Nano-Banana-MCP and since rewritten in TypeScript. It is published as
@fjacquet/nano-banana-mcp, not as the upstreamnano-banana-mcppackage.
What differs from upstream
Five Gemini models (default Nano Banana 2.1) instead of Gemini 2.5 Flash Image only
Image options: aspect ratio,
presetshapes, resolution, thinking level, Google Search groundingImage path validation (allowed extensions, 20MB limit, allowed roots) with unit tests
Built on the MCP SDK
McpServerwith Zod-validated tool inputsAutomated CI, CodeQL and OSV security scans, docs site, and npm publishing with provenance via OIDC
Listed on the official MCP Registry
Documentation: https://fjacquet.github.io/Nano-Banana-MCP/
Related MCP server: Gemini Image Gen MCP Server
Models
Brand name | Model ID | Notes |
Nano Banana 2.1 |
| Default — pro quality at Flash speed |
Nano Banana Pro |
| Highest quality, advanced reasoning |
Nano Banana 2 |
| Previous default |
Nano Banana 2 Lite |
| Fastest and cheapest — 1K output only, no Google Search grounding |
Nano Banana |
| Legacy — shut down by Google on 2027-03-15 |
Quick Start
Get a Gemini API key from Google AI Studio
Add to your MCP client config (Claude Code example):
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "@fjacquet/nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-key-here"
}
}
}
}See docs/configuration.md for Cursor and other MCP clients.
Use the tools:
Generate an image of a sunset over mountains
Edit this image to add some birds in the sky
Continue editing to make it more dramaticTools
Tool | Description |
| Create new images from text prompts |
| Modify existing images with optional reference images |
| Iteratively edit the last image |
| Get info about the last image |
| Set API key |
| Check configuration |
The three generation/editing tools accept these optional parameters:
Option | Purpose |
| Pick one of the models above |
| Output shape; |
| Output resolution |
| Google Search grounding; the queries run are listed in the output |
| Reasoning effort |
See docs/tools.md for the full API reference, docs/configuration.md for setup details, and docs/workflows.md for usage patterns.
Development
npm install
npm run dev # Run with tsx
npm run build # Compile TypeScript
npm test # Jest unit tests
npm run lint # Biome lint
npm run typecheck # Type-check
npm run docs:dev # VitePress docsRequires Node.js >= 18.0.0 (CI runs Node 24).
CI/CD
Workflows in .github/workflows/ call shared workflows from fjacquet/ci.
Workflow | Trigger | What it does |
CI | push / PR to | Install, typecheck, lint, test, build |
Security | push / PR to | CodeQL, OSV-Scanner dependency scan, SBOM |
Docs | push to | Build the VitePress site and deploy to GitHub Pages |
Release |
| Publish to npm (OIDC trusted publishing, reviewer approval), then to the MCP Registry |
Releases are cut by bumping package.json and server.json, updating CHANGELOG.md, and pushing an annotated vX.Y.Z tag.
License
MIT — see LICENSE.
Originally forked from ConechoAI/Nano-Banana-MCP; thanks to its authors for the starting point.
Available Tools
6 toolsconfigure_gemini_tokenB
Configure your Gemini API token for nano-banana image generation
Inputs: apiKey (required).
continue_editingA
Continue editing the LAST image that was generated or edited in this session, optionally using additional reference images. Use this for iterative improvements.
Inputs: prompt (required), model, preset, imageSize, +4 more.
edit_imageB
Edit a SPECIFIC existing image file, optionally using additional reference images. Use this when you have the exact file path of an image to modify.
Inputs: prompt (required), imagePath (required), model, preset, +5 more.
generate_imageA
Generate a NEW image from text prompt. Use this ONLY when creating a completely new image, not when modifying an existing one.
Inputs: prompt (required), model, preset, imageSize, +3 more.
get_configuration_statusB
Check if Gemini API token is configured
Inputs: no named parameters.
get_last_image_infoB
Get information about the last generated/edited image in this session.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
The three image actions are clearly separated by their inputs: generate_image creates new content, edit_image targets an exact file path, and continue_editing operates on the last session image. The descriptions reinforce these boundaries with explicit 'use this ONLY when' guidance, and the config check vs. config set tools are obviously distinct.
All six tools follow a consistent snake_case verb_noun pattern (get_configuration_status, configure_gemini_token, generate_image, edit_image, continue_editing, get_last_image_info). No mixed conventions or vague one-word names.
Six tools is well-scoped for an image generation/editing server: two for authentication, one for session state inspection, and three for the actual generation workflows. Each tool has a clear, non-redundant role.
The core lifecycle is covered: configure token, verify status, generate, edit by path, iterate on the last image, and inspect last image metadata. Minor gaps exist, such as listing prior images or clearing/resetting session state, but these are workarounds agents can manage.
Maintenance
Related MCP Connectors
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models. Up to 4 images per call, SVG vectorization, background removal, upscaling and image-to-video. Remote MCP with OAuth, no API keys.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models and 10 tools: up to 4 images per call, SVG vectorization, editing and more. Remote MCP with OAuth, no API keys. Pay per image, no subscription.
Edit images over MCP with object removal, background removal, and guided generative edits.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables image generation and multi-turn editing sessions using the Gemini API within MCP-compatible environments. Users can create, modify, and configure images through natural language commands, supporting features like aspect ratio adjustments and session-based image transformations.5ISC
- AlicenseAqualityDmaintenanceEnables AI image generation, editing, and upscaling via Google Gemini and Imagen models, supporting dynamic model switching and multiple MCP-compatible clients.12MIT
- AlicenseAqualityCmaintenanceEnables AI image generation and editing using Google's Gemini models via natural language, supporting multi-turn editing, search grounding, storyboards, icon sets, and video-to-image.520 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered image generation and editing using Gemini and Imagen models, supporting text-to-image, image editing, and multi-image composition through MCP tools.MIT