Nanobanana MCP Server
Integrates with Google's Gemini image generation API to generate images from text prompts and edit existing images using natural language instructions.
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., "@Nanobanana MCP Server generate an image of a cozy cabin in snowy woods and save it to cabin.png"
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.
Nanobanana MCP Server
An MCP (Model Context Protocol) server for Google's Gemini image generation API. Generate and edit images using natural language prompts.
Features
Text-to-Image Generation: Create images from descriptive text prompts
Image Editing: Modify existing images using natural language instructions
Multiple Models: Support for Gemini 2.0 Flash image generation models
Related MCP server: Nano Banana MCP
Prerequisites
Node.js 18 or higher
A Google AI API key (get one at https://aistudio.google.com/apikey)
Installation
npm install
npm run buildConfiguration
Set your Gemini API key as an environment variable:
export GEMINI_API_KEY="your-api-key-here"Usage with Claude Code
claude mcp add-json nanobanana '{
"command": "node",
"args": ["/path/to/nanobanana-mcp-server/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}'Available Tools
nanobanana_generate_image
Generate an image from a text prompt.
Parameters:
prompt(required): Text description of the image to generateoutput_path(required): File path to save the generated imagemodel(optional): Gemini model to use (default:gemini-2.0-flash-exp-image-generation)
Example:
Generate an image of a serene mountain lake at sunset with purple and orange sky reflectionsnanobanana_edit_image
Edit an existing image using a text prompt.
Parameters:
prompt(required): Description of the edit to applyimage_path(required): File path to the image to edit (PNG, JPEG, WebP, or GIF)output_path(required): File path to save the edited imagemodel(optional): Gemini model to use
Example:
Change the car color from blue to rednanobanana_list_models
List available Gemini models for image generation.
Parameters:
response_format(optional): Output format -markdownorjson(default:markdown)
Development
# Watch mode with auto-reload
npm run dev
# Build
npm run build
# Run
npm startLicense
MIT
Available Tools
3 toolsnanobanana_edit_imageEdit ImageB
Edit an existing image using a text prompt with Gemini's image editing capabilities.
This tool modifies images based on natural language instructions. You can:
Change colors, objects, or elements
Add or remove items from the scene
Transform the style or mood
Apply effects or filters
Args:
prompt (string): Description of the edit to apply
image_path (string): File path to the image to edit (PNG, JPEG, WebP, or GIF)
model (string): Gemini model to use
output_path (string): File path to save the edited image
Returns: JSON with success, saved_to, mime_type, model, text
Examples:
"Change the car color from blue to red"
"Add a rainbow in the sky"
"Remove the person in the background"
"Make this photo look like an oil painting"
Inputs: prompt (required), image_path (required), output_path (required), model.
nanobanana_generate_imageGenerate ImageA
Generate an image from a text prompt using Google's Gemini image generation models.
This tool creates images from descriptive text prompts using Gemini's multimodal capabilities. For best results, be specific about:
Subject matter and composition
Art style (photorealistic, illustration, oil painting, etc.)
Lighting and atmosphere
Colors and mood
Args:
prompt (string): Text description of the image to generate
model (string): Gemini model to use (default: gemini-2.0-flash-exp-image-generation)
output_path (string): File path to save the generated image
Returns: JSON with success, saved_to, mime_type, model, text
Examples:
"A serene mountain lake at sunset with purple and orange sky reflections"
"Cute cartoon robot holding a coffee cup, digital art style"
"Professional product photo of a sleek smartphone on white background"
Inputs: prompt (required), output_path (required), model.
nanobanana_list_modelsList Available ModelsARead-onlyIdempotent
List the available Gemini models for image generation.
Returns information about each supported model including its capabilities and recommended use cases.
Args:
response_format (string): Output format - 'markdown' or 'json' (default: markdown)
Returns: List of available models with their descriptions and capabilities.
Inputs: response_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools target clearly different operations: creating a new image from a prompt, editing an existing image file, and listing available models. There is no plausible overlap, since the input shape (prompt-only vs. prompt+image_path) makes the boundary between generate and edit unambiguous.
All tools use the identical pattern of a server prefix plus a verb_noun suffix: nanobanana_generate_image, nanobanana_list_models, nanobanana_edit_image. This is a predictable, uniform convention with no deviation in casing or verb style.
Three tools is on the low end but each serves a distinct, necessary role for an image-generation server, with no filler. The surface is tightly scoped rather than bloated, though it sits near the 'thin' boundary.
The core lifecycle is covered: discover models, generate an image, and edit an existing image. Minor gaps exist, such as batch generation or an image-analysis/describe operation, but agents can work around these with repeated single-image calls.
Related MCP Connectors
Generate AI images and videos from your agent: list models, start jobs, and fetch the results.
Generate images, videos and music with model discovery, cost estimates and asynchronous results.
Generate and edit images: article covers, pet portraits, product shots. Each call spends credits.
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables image generation using Google Gemini models like Gemini 2.0 Flash and Imagen 3.0 with support for custom aspect ratios and negative prompts. It also allows users to list and manage generated images stored in local directories.2MIT
- FlicenseNot gradedqualityCmaintenanceEnables image generation and editing using Google's Gemini models with support for model selection and custom aspect ratios. Users can generate high-quality images or modify existing ones through natural language prompts while controlling specific parameters like quality and dimensions.-
- AlicenseAqualityCmaintenanceEnables AI image generation and editing using Google's Gemini Multimodal Image APIs.61MIT
- AlicenseNot gradedqualityDmaintenanceEnables image generation, editing, and refinement using Google's Gemini 2.5 Flash Image model with support for multi-image composition and style transfer.ISC