Gemini Nano Banana MCP
Provides tools for generating and editing images using Google Gemini models, and generating videos using Veo models, with support for text-to-image, image editing, text-to-video, image-to-video, and frame interpolation.
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., "@Gemini Nano Banana MCP generate an image of a banana riding a bicycle"
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.
Gemini Nano Banana MCP
An MCP (Model Context Protocol) server for AI-powered image generation, editing, and video generation using Google Gemini and Veo. Works with Claude Code, Cursor, and any MCP-compatible client.
Features
Text-to-Image Generation - Generate images from text prompts via Gemini AI
Image Editing - Edit existing images with natural language instructions
Reference Images - Use reference images for style and content guidance
Text-to-Video Generation - Generate videos from text prompts using Veo (veo-3.1, veo-3, veo-2)
Image-to-Video - Use an image as the first frame for video generation
First & Last Frame Interpolation - Generate videos between two keyframe images
Session Memory - Continue editing the last image without re-specifying the path
Configurable Models - Choose any Gemini model for images, any Veo model for videos
Media History - Track and browse recently generated images and videos
Cross-Platform - Works on macOS, Windows, and Linux
Related MCP server: Gemini Media MCP
Quick Start
1. Get a Gemini API Key
Get your free API key from Google AI Studio.
2. Install
npm install -g @seungmanchoi/nano-banana-mcpOr install from source:
git clone https://github.com/seungmanchoi/nano-banana-mcp.git
cd nano-banana-mcp
npm install
npm run build3. Configure Your MCP Client
Claude Code
Add to ~/.claude/settings.json:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "@seungmanchoi/nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}Cursor
Add to your MCP settings:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "@seungmanchoi/nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}From Source
If installed from source, use the absolute path:
{
"mcpServers": {
"nano-banana": {
"command": "node",
"args": ["/absolute/path/to/nano-banana-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}You can also skip the
envfield and configure the API key at runtime using theconfigure_api_keytool.
Authentication Modes
This server supports two authentication modes. The default is API key mode (above).
Mode A — API key (official, default)
Uses a Gemini API key from Google AI Studio. Supports image generation, image editing, and video (Veo). Note that image generation models are largely a paid feature.
Mode B — Free Google-cookie mode (consumer Gemini, unofficial)
Drives your logged-in gemini.google.com session via its session cookies instead of an API key. Free, and supports image generation + editing only (no video).
⚠️ This mode is unofficial. It talks to an undocumented internal endpoint, not the official API. It may break when Google changes things, cookies expire periodically and must be re-extracted, and use is a Terms-of-Service gray area. Intended for personal use with your own account.
1. Extract your cookies from a browser where you're logged into gemini.google.com:
Open
https://gemini.google.comand sign in.DevTools (F12) → Application → Cookies →
https://gemini.google.com.Copy the value of
__Secure-1PSID(required) and__Secure-1PSIDTS(recommended).
2a. Configure via environment variables:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "@seungmanchoi/nano-banana-mcp"],
"env": {
"GEMINI_AUTH_MODE": "gemini-web",
"GEMINI_SECURE_1PSID": "your-__Secure-1PSID-value",
"GEMINI_SECURE_1PSIDTS": "your-__Secure-1PSIDTS-value"
}
}
}
}2b. Or configure at runtime with the configure_google_login tool:
Use configure_google_login with secure1psid "<...>" and secure1psidts "<...>"This switches the active mode to gemini-web and persists to ~/.nano-banana/config.json.
Run configure_api_key again at any time to switch back to API key mode.
Model Configuration
Image Models
The default image model is gemini-2.0-flash-preview-image-generation. You can change it in several ways:
Option 1: Environment Variable
Set GEMINI_MODEL in your MCP client config:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "@seungmanchoi/nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key-here",
"GEMINI_MODEL": "gemini-2.0-flash-preview-image-generation"
}
}
}
}Option 2: Runtime Tool
Use the configure_model tool to change the default model at runtime. The setting persists across sessions in ~/.nano-banana/config.json.
Set the model to imagen-3.0-generate-002Option 3: Per-Request Override
Pass the model parameter directly to generate_image, edit_image, or continue_editing to override the default for a single request:
Generate an image of a cat using model imagen-3.0-generate-002Model Priority
Per-request
modelparameter (highest priority)GEMINI_MODELenvironment variableConfig file (
~/.nano-banana/config.json)Default:
gemini-2.0-flash-preview-image-generation
Available Image Models
Model | Tier | Description |
| Free | Default. Native image generation via Gemini 2.0 Flash. |
| Paid | Best quality. Google's dedicated image generation model. |
| Paid | Fast variant of Imagen 3, optimized for speed. |
Note: Free-tier API keys support
gemini-2.0-flash-preview-image-generation. Imagen models require billing enabled on your Google Cloud project.
Available Video Models
Model | Description |
| Latest. Native audio, scene extension, reference images, 4K support. |
| Previous generation with audio support. |
| Older generation, stable. |
For the latest list of models, see Google AI documentation.
Tools
Image Tools
Tool | Description |
| Set or update the Gemini API key (switches to apiKey mode). Persists across sessions. |
| Switch to free, unofficial |
| Set the default Gemini model for images (apiKey mode). Persists across sessions. |
| Generate a new image from a text description. Supports optional |
| Edit an existing image with text instructions, optional reference images, and optional |
| Continue editing the last generated/edited image in the session. Supports optional |
| List recently generated and edited images with prompts and timestamps. |
Video Tools
Tool | Description |
| Generate a video from a text prompt. Supports text-to-video, image-to-video, and frame interpolation. |
| List recently generated videos with prompts, models, and timestamps. |
Utility Tools
Tool | Description |
| Check configuration status, active models, output directories, and last image/video info. |
Usage Examples
Image Generation
Generate an image of a sunset over mountains with a lake reflectionEdit the image at ~/nano-banana-images/gen_2025-01-01.png to add a boat on the lakeContinue editing - make the sky more vibrant with orange and pink tonesVideo Generation
Generate a video of ocean waves crashing on a rocky shore at sunsetGenerate a video of a cat playing with yarn, model veo-3.1-generate-preview, resolution 1080p, duration 8 secondsImage-to-Video (First Frame)
Generate a video starting from the image at ~/nano-banana-images/gen_2025-01-01.png showing the scene coming to life with wind blowing through the treesFirst + Last Frame Interpolation
Generate a video transitioning from the image at ~/images/start.png to ~/images/end.png with a smooth camera panPortrait Video
Generate a video of a person walking through a garden, aspect ratio 9:16History & Status
Show me the last 5 images I generatedShow me recent video historyCheck the current statusSwitch to imagen-3.0-generate-002 model for higher qualityVideo Generation Details
Configuration Options
Parameter | Options | Default | Description |
|
|
| Veo model to use |
|
|
| Landscape or portrait |
|
|
| Output resolution |
|
| Varies by model | Video length |
|
|
| Number of variants |
| Any text | - | Elements to avoid |
Generation Modes
Text-to-Video: Provide only a
promptImage-to-Video: Provide
prompt+imagePath(used as first frame)Frame Interpolation: Provide
prompt+imagePath(first frame) +lastFramePath(last frame)
Important Notes
Video generation takes 1-6 minutes depending on load
Generated videos are saved as
.mp4filesVideos are watermarked with SynthID technology
Pricing: $0.75 per second of generated video
Videos are retained on Google servers for 2 days after generation
API Key Configuration
The server loads the API key in the following priority order:
Environment variable -
GEMINI_API_KEYConfig file -
~/.nano-banana/config.jsonRuntime - via the
configure_api_keytool
File Storage
Images
Platform | Path |
macOS / Linux |
|
Windows |
|
Videos
Platform | Path |
macOS / Linux |
|
Windows |
|
Project Structure
src/
├── index.ts # Entry point
├── server.ts # MCP server setup and request routing
├── config/
│ └── settings.ts # API key and model management
├── services/
│ ├── gemini.ts # Google Gemini & Veo API client
│ └── storage.ts # Image/video file I/O and history tracking
├── tools/
│ ├── definitions.ts # MCP tool schemas
│ └── handlers.ts # Tool request handlers
└── types/
└── index.ts # TypeScript type definitionsDevelopment
npm run dev # Run with tsx (no build needed)
npm run build # Compile TypeScript
npm run typecheck # Type check without emitting
npm run lint # Run ESLintTech Stack
Runtime: Node.js
Language: TypeScript (strict mode, ES2022)
MCP SDK:
@modelcontextprotocol/sdkAI Models: Google Gemini (images) + Veo (videos)
Validation: Zod
License
MIT
Available Tools
10 toolsconfigure_api_keyA
Set or update the Gemini API key for image generation. The key is stored locally and persists across sessions.
Inputs: apiKey (required).
configure_google_loginA
Switch to the free, unofficial "gemini-web" auth mode that uses your logged-in consumer Gemini (gemini.google.com) session instead of an API key. Supports image generation and editing (no video). Extract the cookies from your browser DevTools (Application > Cookies > gemini.google.com). Cookies are stored locally and may need re-extraction when they expire.
Inputs: secure1psid (required), secure1psidts.
configure_modelA
Set the default Gemini model for image generation and editing. Persists across sessions. Use "quality" param to set either "high" (default) or "fast" model tier. High-quality: gemini-3.1-flash-image-preview (default). Fast/cheap: gemini-2.5-flash-image (default fast).
Inputs: model (required), quality.
continue_editingA
Continue editing the last generated or edited image. Automatically uses the most recent image from the session.
Inputs: prompt (required), referenceImages, model, quality.
edit_imageB
Edit an existing image based on text instructions. Provide the file path of the image to modify.
Inputs: imagePath (required), prompt (required), referenceImages, model, +1 more.
generate_imageA
Generate a new image from a text description using Gemini AI. Returns the generated image and saves it to disk.
Inputs: prompt (required), model, quality.
generate_videoA
Generate a video from a text prompt using Gemini Veo. Supports text-to-video, image-to-video (first frame), and first+last frame interpolation. Video generation takes 1-6 minutes. Available models: veo-3.1-generate-preview (latest), veo-3-generate-preview, veo-2-generate-preview.
Inputs: prompt (required), model, imagePath, lastFramePath, +5 more.
get_statusA
Check the current configuration status, active model, and last image/video information.
Inputs: no named parameters.
list_historyA
List recently generated and edited images with their prompts and timestamps.
Inputs: count.
list_video_historyA
List recently generated videos with their prompts, models, and timestamps.
Inputs: count.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct operation: configuration tools are separated by purpose (API key, Google login, model), image tools separate generation from editing and continuation, video tool stands alone, and info tools provide status and history without overlap.
All tools follow a consistent verb_noun snake_case pattern (e.g., configure_api_key, generate_image, list_history). The only slight deviation is 'continue_editing' (gerund) but it still fits the verb+noun structure.
The server covers configuration (3 tools), image generation/editing (3), video generation (1), and info retrieval (3) with a total of 10 tools. This is well-scoped for a Gemini AI media generation server without unnecessary bloat.
The tool surface covers the full lifecycle: configuration, generation, editing, and history. A minor gap is the lack of delete or management actions for generated media, but the core workflow is complete.
Maintenance
Related MCP Connectors
MCP server for Google Veo AI video generation
MCP server for Luma Dream Machine AI video generation
MCP server for Wan AI video generation
MCP server for Midjourney AI image generation and editing
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for AI-powered media generation using Google Gemini, enabling creation of images, videos, music, and speech directly from AI agents.431 PyPIMIT
- AlicenseNot gradedqualityBmaintenanceMCP server for generating images and videos using Google Gemini and VEO models, with support for multiple AI models and credential modes.289 PyPI1Apache 2.0
- AlicenseBqualityDmaintenanceMCP server for generating images and audio using Google's Gemini AI models.2106 PyPI2MIT
- AlicenseBqualityBmaintenanceAn MCP server for AI-powered image generation, editing, analysis, and transformation using Google's Gemini and Imagen 4 models.19144 PyPI2AGPL 3.0