mcp-nano-banana
Provides AI-powered image generation, editing, and combination using Google Gemini models (Nano Banana Pro, Nano Banana 2, Nano Banana). Supports text-to-image, image editing with reference images, and multi-image composition at various resolutions and aspect ratios.
Click on "Install 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., "@mcp-nano-bananacreate a 1024x1024 image of a futuristic robot holding a banana"
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.
mcp-nano-banana
MCP server for AI-powered image generation using Google Gemini Nano Banana models. Generate, edit, and combine images from text prompts — directly from your AI coding assistant.
Features
Text-to-image generation — Create images from natural language descriptions
Image editing — Upload images and modify them with text instructions
Multi-image combination — Mix up to 14 reference images into one composite
Resolution control — Generate at 512px, 1K, 2K, or 4K resolution
13+ aspect ratios — From square (1:1) to ultra-wide (21:9) and tall (1:8)
Auto-fallback — Pro model falls back to Flash on rate limits (429/403/402)
File output — Save to specific paths or return inline base64
Favicon generation — Generate complete favicon packages with one command
Multi-format output — PNG, JPEG, and WebP support
Related MCP server: Nano-Banana MCP Server
Quick Start
Prerequisites
Get a Gemini API key from Google AI Studio
Enable billing on your Google Cloud project — image generation requires a paid tier (~$0.04-0.05/image for NB2 at standard resolution)
Installation
npm install -g mcp-nano-bananaSet your API key:
export GEMINI_API_KEY=your-api-keyFor MCP Registry publication metadata, the registry name is io.github.codeFi/mcp-nano-banana.
MCP Configuration
Codex
codex mcp add nano-banana --env GEMINI_API_KEY=your-api-key -- npx -y mcp-nano-banana@latestOr add manually to ~/.codex/config.toml:
[mcp_servers.nano-banana]
command = "npx"
args = ["-y", "mcp-nano-banana@latest"]
[mcp_servers.nano-banana.env]
GEMINI_API_KEY = "your-api-key"Qwen Code
Add to ~/.qwen/settings.json:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "mcp-nano-banana@latest"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}Claude Code
claude mcp add nano-banana -e GEMINI_API_KEY=your-api-key -- npx -y mcp-nano-banana@latestOr add manually to ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "mcp-nano-banana@latest"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}Other MCP Clients
For CLIs and desktop clients that use the standard mcpServers JSON format, register:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "mcp-nano-banana@latest"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}Local / Development Build
git clone https://github.com/codeFi/mcp-nano-banana.git
cd mcp-nano-banana
npm install
npm run buildThen register with your MCP client:
{
"mcpServers": {
"nano-banana": {
"command": "node",
"args": ["/path/to/mcp-nano-banana/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}Models
Model | MCP Name | Description | Max Ref Images |
| Nano Banana Pro | High quality, thinking mode, professional assets | 6 object + 5 character |
| Nano Banana 2 | Fast, high-efficiency, 1:4/4:1/1:8/8:1 ratios | 10 object + 4 character |
| Nano Banana | Fastest, optimized for high-volume tasks | - |
The server defaults to Nano Banana Pro for best quality and automatically falls back to Flash on rate limits.
Available Parameters
Resolution
Value | Approx. Pixels | Supported Models |
| ~512px | Nano Banana 2 only |
| ~1024px | All models |
| ~2048px | All models |
| ~4096px | All models |
Default: "1K"
Aspect Ratio
Value | Dimensions at 1K | Common Use Case |
| 1024×1024 | Social posts, icons |
| 1344×768 | Headers, presentations |
| 768×1344 | Stories, mobile |
| 1152×896 | Desktop, photos |
| 896×1152 | Portraits |
| ~896×1344 | Print, magazines |
| ~1344×896 | Photos |
| ~896×1120 | Instagram posts |
| ~1120×896 | Instagram landscape |
| ~2048×878 | Ultra-wide banners |
| ~512×2048 | Nano Banana 2 only — tall strips |
| ~2048×512 | Nano Banana 2 only — wide strips |
| ~512×4096 | Nano Banana 2 only — extra tall |
| ~4096×512 | Nano Banana 2 only — extra wide |
Tools
generate_image
Generate or edit images from text prompts.
Parameter | Type | Required | Default | Description |
| string | ✅ Yes | — | Text description or editing instructions |
| string[] | No | — | Reference image paths on disk (up to 14) |
| string | No |
| Model to use |
| string | No |
| See table above for all options |
| string | No |
|
|
| string | No |
|
|
| string | No | — | Save image to this file path |
Examples
Generate from text:
{
"prompt": "A sunset over mountains with dramatic lighting",
"aspectRatio": "16:9",
"resolution": "2K",
"outputPath": "/Users/currentUser/Desktop/sunset.png"
}Edit an existing image:
{
"prompt": "Change the background to a coffee shop interior",
"imagePaths": ["/Users/currentUser/photo.jpg"],
"outputPath": "/Users/currentUser/edited.png"
}Combine multiple images:
{
"prompt": "Put these glasses on this person's face",
"imagePaths": ["/path/to/face.jpg", "/path/to/glasses.jpg"],
"outputPath": "/path/to/result.png"
}High-res wallpaper:
{
"prompt": "A futuristic cityscape at night with neon lights and rain",
"aspectRatio": "16:9",
"resolution": "4K",
"outputPath": "/path/to/wallpaper.png"
}generate_favicons
Generate a complete favicon package from a prompt or existing image.
Parameter | Type | Required | Default | Description |
| string | No* | — | Icon description (required if |
| string | No* | — | Path to existing master icon image |
| string | No |
| Model for prompt generation |
| string | No | — | Directory for individual favicon files |
| string | No | — | Save ZIP package to this path |
| boolean | No |
| Return ZIP as base64 text |
| string | No |
| Manifest |
| string | No |
| Manifest |
| string | No |
| Manifest theme color |
| string | No |
| Manifest background color |
| boolean | No |
| Include README.md in package |
Example
{
"prompt": "A minimalist banana icon with a soft gradient",
"outputDir": "/path/to/favicon",
"outputPath": "/path/to/favicon.zip",
"appName": "MyBrand",
"shortName": "Brand",
"themeColor": "#1a1a2e",
"backgroundColor": "#ffffff"
}Generated files:
favicon.ico— Multi-size icon (16/32/48px)favicon-16x16.png— Browser tabsfavicon-32x32.png— Higher-res tabsapple-touch-icon.png— iOS home screenandroid-chrome-192x192.png— Androidandroid-chrome-512x512.png— Android HDsite.webmanifest— PWA manifest
HTML snippet (included in response):
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">Pricing
Image generation requires a paid Google AI Studio account. Approximate costs:
Model | 1K | 2K | 4K |
Nano Banana 2 | ~$0.04 | ~$0.08 | ~$0.15 |
Nano Banana Pro | ~$0.06 | ~$0.13 | ~$0.24 |
You only pay for what you generate — no monthly minimum.
Supported Image Formats
Input (reference images): png, jpg, jpeg, webp, gif
Output: png, jpeg, webp
Development
# Build TypeScript
npm run build
# Watch mode
npm run dev
# Run tests
npm test
# Run the server directly
node dist/index.jsTroubleshooting
Issue | Solution |
| Export the env var or add it to your MCP config |
| Server auto-falls back to Flash model. Add billing to your account. |
| Enable billing at Google Cloud Console |
| High demand — retry in a moment. Common with 4K requests. |
Image not updating after edit | Make sure you rebuilt the TypeScript ( |
| Use absolute paths. Relative paths may not resolve correctly. |
Architecture
AI Assistant (MCP Client)
│ (MCP Protocol over stdio)
▼
mcp-nano-banana Server
│ (HTTPS POST)
▼
Google Gemini API
│
▼
Generated Image → saved to outputPath (or returned inline base64)License
Author
Available Tools
2 toolsgenerate_faviconsA
Generate a full favicon package from a prompt or an existing image. Creates PNG sizes, a web manifest, and optional README, then writes files and/or a ZIP bundle.
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use when generating the master icon from a prompt. | gemini-3-pro-image-preview |
| prompt | No | Text description for generating a master icon (square). Required if imagePath is not provided. | |
| appName | No | Manifest app name. Default: My App. | |
| imagePath | No | Path to an existing master icon image. If provided, prompt is optional. | |
| outputDir | No | Directory to write individual favicon files. | |
| shortName | No | Manifest short name. Default: App. | |
| outputPath | No | File path to save the favicon ZIP package. | |
| themeColor | No | Manifest theme color. Default: #ffffff. | |
| includeReadme | No | Include README.md in the package. | |
| backgroundColor | No | Manifest background color. Default: #ffffff. | |
| returnZipBase64 | No | When true and outputPath is not provided, return the ZIP as base64 text. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that files and/or a ZIP bundle are written and mentions optional README, but does not cover return behavior (returnZipBase64), overwrite semantics, or behavior when output destinations are missing. This is partial disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the main action and outputs. No filler, every clause adds useful signal. This is highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 11 parameters and no output schema, and while the description captures the core workflow, it leaves gaps about the interplay between outputDir, outputPath, and returnZipBase64. It also doesn't state what happens if no output destination is given, making it incomplete for complex usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema covers all 11 parameters with descriptions, so the baseline is 3. The description adds a high-level note about prompt vs imagePath and output formats, but doesn't enrich individual parameter semantics beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource ('Generate a full favicon package') and enumerates concrete outputs (PNG sizes, web manifest, optional README, files/ZIP bundle). This clearly distinguishes it from the sibling generate_image, which is for generic image generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly defines the tool's purpose by contrasting with generate_image and stating the input modes (prompt or existing image). However, it does not explicitly name alternatives or state when not to use this tool, so it lacks a full 'when-to-use' guide.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageA
Generate an image using Google Nano Banana (Gemini) AI model. Can generate from text only, or use one or more reference images (up to 14) to guide generation.
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use: gemini-2.5-flash-image (fast) or gemini-3-pro-image-preview (high quality, default) | gemini-3-pro-image-preview |
| prompt | Yes | Text description of the image to generate or instructions for editing/combining reference images | |
| imagePaths | No | Optional array of file paths to reference images (up to 14). Supports png, jpg, jpeg, webp, gif. | |
| outputPath | No | File path to save the generated image. If not provided, image data is returned inline. | |
| resolution | No | Resolution of the generated image. 512 only on gemini-3.1-flash-image-preview. Nano Banana Pro supports 1K, 2K, 4K. | 1K |
| aspectRatio | No | Aspect ratio of the generated image. Additional ratios (1:4, 4:1, 1:8, 8:1) available on gemini-3.1-flash-image-preview. | 1:1 |
| outputFormat | No | Output image format | png |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It discloses the AI model and the capability to accept up to 14 reference images, but doesn't address return behavior or potential pitfalls. The outputPath schema covers the return mechanism, so partial credit is warranted.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the core action and resource. Every word contributes to understanding the tool's purpose and main capabilities.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description provides a high-level overview of the tool's capability, and the rich schema covers all parameters. Since there is no output schema, the description could mention the inline return behavior, but the outputPath parameter description already covers it. Adequate for a generation tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description only repeats the 'up to 14' reference image limit, which is already in the imagePaths parameter description, adding no new semantic value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's primary function: generating an image using the Google Nano Banana (Gemini) AI model. It distinguishes from the sibling tool generate_favicons by covering general image generation with text or reference images.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly identifies two usage modes: text-only generation and reference-image-guided generation. It does not mention alternatives or exclusions, but the context is clear enough for typical use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.2.2- First observed
generate_favicons - First observed
generate_image
TDQS
The two tools are clearly distinct: generate_image produces a single image from text or references, while generate_favicons creates a package of favicon files. There is no overlap in their purposes, so an agent can easily choose between them.
Both tool names follow the same verb_noun pattern (generate_image, generate_favicons). The naming is perfectly consistent and predictable.
With only 2 tools, the set is on the smaller side, but it is appropriately scoped for a server dedicated to Nano Banana image generation. The two tools cover both general image generation and a specific use case (favicons), so the count feels intentional rather than insufficient.
The tool surface covers the core generation capabilities: text-to-image and image-to-image via references, plus a specialized favicon output. Minor gaps exist (e.g., no explicit editing/upscaling tool, no model listing), but the server's stated purpose is well-served.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for NanoBanana AI image generation and editing
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
MCP server for Google Veo AI video generation
Related MCP Servers
- FlicenseBqualityDmaintenanceAn MCP server that enables image generation using Google's Gemini Nano Banana Pro model via the Google AI Studio API. Users can generate and save images locally by providing text prompts through MCP-compatible clients.1-
- AlicenseAqualityDmaintenanceAn MCP server that provides AI image generation and editing capabilities using Google's Gemini 2.5 Flash Image API. It allows users to create new images from text, modify existing files, and perform iterative edits through natural language prompts.6758MIT
- AlicenseNot gradedqualityCmaintenanceAI-powered image generation MCP server with 16 specialized tools for generating, editing, analyzing, and processing images using Google's Nano Banana 2 model. Supports custom API endpoints and integrates with AI coding assistants via natural language.821MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides image generation using Google's Nano Banana Gemini models, with additional tools for background removal, upscaling, and format conversion via deterministic post-processing.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/codeFi/mcp-nano-banana'
If you have feedback or need assistance with the MCP directory API, please join our Discord server