NanoBanana Pro 2

io.github.u2n4Published by GitHub account u2n4v1.1.2Updated Oct 24, 2026

4K AI image generation via NanoBanana Pro 2: Pro + Flash models, Google Search grounding

VerifiedSTDIODesktop onlyMedia & DesignAI & ML

Overview

AI-generated overview

Local MCP server that lets an assistant generate and edit AI images with NanoBanana Pro 2 (Pro and Flash models) at up to 4K resolution.

What you can do
Generate images from text prompts with model, aspect ratio, resolution, negative prompt, thinking level, grounding and batch options, and edit images using uploaded reference images for consistent multi-angle results. Upload reference images for editing or conditioning. Review statistics on generated images, including count, total size and file details. Run maintenance to clear caches, remove temporary files and optimize storage.
When to use it
Useful when you want an assistant to create or edit images on demand, from quick Flash iterations to high-quality 4K Pro renders, including real-world subjects via Google Search grounding.
Requirements
Runs locally as a Python package (pip or uvx) on desktop. Requires a Gemini API key in the GEMINI_API_KEY environment variable. Optionally set IMAGE_OUTPUT_DIR for output location and NANOBANANA_DB_PATH for the SQLite metadata database; network access is needed for generation.
Before you install
The Gemini API key is a credential and is passed in plain configuration. Generation sends prompts and any reference images to Google's Gemini service. Images and a SQLite metadata database are written to disk by default; maintenance can delete caches and temporary files, and setting NANOBANANA_DB_PATH to :memory: discards image history on restart.

Installation

In SourceWeft

  1. Open NanoBanana Pro 2 in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

NanoBanana MCP Server

MCP server for AI image generation using NanoBanana Pro 2. Supports Pro (maximum quality) and Flash (fast generation) models with default 4K resolution.

Inspired by the nano-banana naming convention used across the MCP community. This is an independent implementation.

Quick Install

bash
pip install nanobanana-imagen-mcp# oruvx nanobanana-imagen-mcp --help

Claude Desktop (claude_desktop_config.json):

json
{  "mcpServers": {    "nanobanana": {      "command": "uvx",      "args": ["nanobanana-imagen-mcp"],      "env": {        "GEMINI_API_KEY": "your_key_here"      }    }  }}
VariableDescriptionDefault
GEMINI_API_KEYGemini API key — required for all generation--
IMAGE_OUTPUT_DIRDirectory where generated images are saved~/nanobanana-images
NANOBANANA_DB_PATHSQLite database path for image metadata~/nanobanana-images/images.db

What It Does

Generates AI images using NanoBanana Pro 2 models. Supports text-to-image generation, image editing with reference images, file uploads, and server maintenance. Produces high-quality images at up to 4K resolution.

Tools (4)

ToolDescription
generate_imageGenerate images using NanoBanana Pro 2. Supports model selection (Pro/Flash), aspect ratio, resolution (up to 4K), negative prompts, thinking level, grounding, reference images, and batch generation.
upload_fileUpload a reference image for use in image editing or conditioning.
show_output_statsDisplay statistics about generated images — count, total size, file details.
maintenanceServer maintenance and cleanup — clear caches, remove temporary files, optimize storage.

Models

ModelEngineBest For
ProGemini 3 Pro ImageMaximum quality, complex scenes, photorealism
FlashGemini 3.1 Flash ImageFast generation, simple scenes, quick iterations

Configuration

VariableDescriptionDefault
GEMINI_API_KEYGemini API key (required)--
IMAGE_OUTPUT_DIROutput directory for generated images~/nanobanana-images

Storage

Generated image metadata is tracked in a SQLite database.

VariableDescriptionDefault
NANOBANANA_DB_PATHPath to the SQLite metadata database~/nanobanana-images/images.db

Opt out of persistent storage by setting NANOBANANA_DB_PATH=:memory:. This uses an in-memory database that is discarded when the server exits — useful for ephemeral or read-only environments. Trade-off: image history is lost on restart; the show_output_stats tool will show an empty database each session.

The database and output directories are created lazily on first image generation — starting the server with no GEMINI_API_KEY set (e.g. nanobanana-imagen-mcp --help) does not create any files or directories.

Claude Desktop Configuration

From pip (recommended)

bash
pip install nanobanana-imagen-mcp
json
{  "mcpServers": {    "nanobanana": {      "command": "uvx",      "args": ["nanobanana-imagen-mcp"],      "env": {        "GEMINI_API_KEY": "your_key_here"      }    }  }}

From this repository

json
{  "mcpServers": {    "nanobanana": {      "command": "python",      "args": ["-m", "servers.nanobanana.nanobanana_mcp_server.server"],      "env": {        "GEMINI_API_KEY": "your_key_here"      },      "cwd": "path/to/gemini-media-mcp"    }  }}

Features

  • Default 4K resolution for maximum detail
  • Pro model for complex, photorealistic scenes
  • Flash model for fast iterations and simple subjects
  • Reference image support for consistent multi-angle shots
  • Negative prompt support for quality control
  • Thinking level control for complex multi-element scenes
  • Google Search grounding for real-world subjects

License

MIT

Credits

Inspired by the nano-banana naming convention used across the MCP community. This is an independent implementation.

Source: servers/nanobanana/README.md at commit 1b8fc5a

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.1.2LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts