Gemini Nanobanana MCP
Enables text-to-image generation, image editing, image composition, and style transfer using Google's Gemini 2.5 Flash Image generation model through natural language prompts.
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., "@Gemini Nanobanana MCPGenerate a cute puppy playing in a garden"
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 Nanobanana MCP
Generate images from text with Claude! Simply type "Draw a cute cat" and get instant AI-generated images.
A beginner-friendly Model Context Protocol (MCP) server that brings Google's Gemini 2.5 Flash Image generation directly into your Claude conversations.
Quick Start - Just 3 Steps
1οΈβ£ Get Your API Key (1 minute)
Visit Google AI Studio
Sign in with your Google account
Click "Create API key" β Copy the key
2οΈβ£ Install in Your Claude Client (2 minutes)
Open Notepad
Copy this code and replace
YOUR_API_KEYwith your actual key:
{
"mcpServers": {
"gemini-nanobanana-mcp": {
"command": "npx",
"args": ["gemini-nanobanana-mcp@latest"],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY"
}
}
}
}Save as:
%APPDATA%/Claude/claude_desktop_config.jsonRestart Claude Desktop
Open Terminal (search "Terminal" in Spotlight)
Run this command (replace
YOUR_API_KEY):
cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json << 'EOF'
{
"mcpServers": {
"gemini-nanobanana-mcp": {
"command": "npx",
"args": ["gemini-nanobanana-mcp@latest"],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY"
}
}
}
}
EOFRestart Claude Desktop
Just run this one command in your terminal (replace YOUR_API_KEY):
claude mcp add gemini-nanobanana-mcp -s user -e GEMINI_API_KEY="YOUR_API_KEY" -- npx -y gemini-nanobanana-mcp@latestGo to
Cursor SettingsβMCPβAdd new MCP ServerFill in:
Name:
gemini-nanobanana-mcpCommand:
npxArgs:
gemini-nanobanana-mcp@latestEnvironment Variables:
GEMINI_API_KEY=YOUR_API_KEY
Restart Cursor
3οΈβ£ Start Creating! (0 minutes)
Try these in Claude:
"Generate a cute puppy playing in a garden"
"Create a beautiful sunset over mountains"
"Draw a red sports car"
"Make an abstract colorful painting"
Your images automatically save to ~/Downloads/gemini-images/
Related MCP server: Gemini 2.5 Flash Image MCP
See It In Action
Basic Usage
You: Generate a cozy coffee shop interior
Claude: [Generating image...]
Image generated and saved to: ~/Downloads/gemini-images/generate-2025-01-09-14-30-45.png
Size: 1.2MB | Format: PNGCustom Save Location
You: Create a sunset landscape and save it as ./my-sunset.png
Claude: Image saved to: ./my-sunset.pngWhat You Can Do
Text-to-Image Generation
Create any image you can imagine from a text description.
Examples:
"A majestic dragon flying over a medieval castle""Modern minimalist living room with plants""Vintage bicycle on a cobblestone street"
Image Editing
Edit existing images with natural language instructions.
How to use:
Upload an image to Claude
Say:
"Make this image black and white"Or:
"Add a sunset background to this photo"
Image Composition
Combine multiple images into one creative composition.
How to use:
Upload 2-10 images to Claude
Say:
"Combine these images into a collage"Or:
"Blend these photos together artistically"
Style Transfer
Apply the artistic style of one image to another.
How to use:
Upload two images: a content image and a style reference
Say:
"Apply the style of the second image to the first"
Configuration Options
Variable | Default | Description |
| Required | Your Google AI Studio API key |
|
| Automatically save images when no path specified |
|
| Default directory for saved images |
|
| Logging level ( |
Example with custom settings:
{
"mcpServers": {
"gemini-nanobanana-mcp": {
"command": "npx",
"args": ["gemini-nanobanana-mcp@latest"],
"env": {
"GEMINI_API_KEY": "your-api-key",
"AUTO_SAVE": "true",
"DEFAULT_SAVE_DIR": "~/Pictures/AI-Images",
"LOG_LEVEL": "debug"
}
}
}
}To only save when you explicitly request it:
{
"env": {
"GEMINI_API_KEY": "your-api-key",
"AUTO_SAVE": "false"
}
}Then images will only appear in the chat without saving to disk.
Instant Image Preview (Claude Code)
Want images to open automatically after generation? Set up Claude Code hooks for instant Quick Look previews!
One-Click Setup (Mac)
# Clone this repo and run the installer
git clone https://github.com/nanobanana/nanobanana-mcp.git
cd nanobanana-mcp
bash hooks/install.shWhat You Get
Instant Preview: Generated images open automatically in Quick Look
Zero Manual Work: No more finding and opening files
Smart Detection: Only triggers for nanobanana image tools
Press Space to Close: Standard Quick Look controls
Full setup guide: hooks/README.md
Troubleshooting
Solution:
Double-check you replaced
YOUR_API_KEYwith your actual API keyMake sure there are no extra spaces around the key
Restart your Claude client completely
Verify your API key works at Google AI Studio
Solution:
Install Node.js from nodejs.org (choose LTS version)
Restart your terminal/Claude client
Try the installation again
Checklist:
API key correctly set?
Internet connection working?
Restart Claude after configuration?
Try a simple prompt: "Generate a blue circle"
Solution:
Check your configuration has AUTO_SAVE: "true" (default behavior).
If you want to disable auto-save, set it to "false".
Common fixes:
Make sure you're using Claude Code (not Claude Desktop)
Run the installer from the nanobanana-mcp directory
Restart Claude Code after installation
Check hooks/README.md for detailed troubleshooting
Tips for Better Images
Prompt Writing Tips
Be specific: "A golden retriever puppy" vs "A dog"
Include style: "in watercolor style", "photorealistic", "cartoon style"
Add details: "with blue eyes", "in a sunny garden", "wearing a red collar"
Set the mood: "cozy", "dramatic", "peaceful", "energetic"
Technical Details
Supported formats: PNG, JPEG, WebP, GIF
Default output: PNG format
Image size: Optimized for quality and reasonable file size
Rate limits: Managed automatically with retry logic
π Advanced Features
Run as an HTTP server instead of stdio:
MCP_TRANSPORT=http MCP_HTTP_PORT=8080 npx gemini-nanobanana-mcp@latestAccess at http://localhost:8080/mcp
Enable detailed logging:
{
"env": {
"GEMINI_API_KEY": "your-key",
"LOG_LEVEL": "debug"
}
}π‘ Need Help?
π Quick Setup Guide: QUICK_START.md
πͺ Auto-Preview Setup: hooks/README.md
π Report Issues: GitHub Issues
π¬ Feature Requests: Welcome!
π€ Contributing
Found a bug? Have a feature idea? Contributions are welcome!
Fork the repository
Create your feature branch
Make your changes
Submit a pull request
π License
MIT License - feel free to use this in your own projects!
β If this helped you, please star the repository on GitHub!
Built with β€οΈ for the Claude community
Available Tools
4 toolscompose_imagesC
Compose a new image using multiple input images and a guiding prompt.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Describe how to compose the elements of the input images. | |
| images | Yes | ||
| saveToFilePath | No | Optional path to save the composed image |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description offers no behavioral details such as output format, side effects, or required permissions. Only restates purpose.
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?
Single sentence, efficient but too minimal. Could be expanded with key behavioral info without losing conciseness.
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?
Lacks output schema and annotations. Does not explain return value or behavior. Severely incomplete for a tool with 3 parameters.
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?
Description adds minimal value to schema: 'multiple input images' is redundant with schema. The prompt description is less informative than the schema's detailed description. Missing schema coverage for images items not compensated.
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 action (compose) and resource (new image), using multiple input images and a guiding prompt. It distinguishes from sibling tools: edit_image edits existing, generate_image creates from scratch, style_transfer applies style.
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?
No guidance on when to use this tool versus alternatives. Lacks explicit context or when-not-to-use conditions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
edit_imageA
Edit an image using a prompt. Provide one input image via base64 or file path.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Describe the edit; the model matches original style and lighting. | |
| image | Yes | One input image | |
| saveToFilePath | No | Optional path to save the edited image |
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 mentions the model matches original style and lighting, a useful behavioral trait, but omits potential side effects, limitations, or output details.
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?
The description is extremely concise (two short sentences) with no extraneous information. It could be slightly improved by front-loading the core action, but it's very efficient.
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?
Given no output schema and no annotations, the description lacks information about the return value (e.g., whether the edited image is returned as base64 or saved to a path). This gap in completeness moderately hampers agent decision-making.
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 baseline is 3. The description restates what is already in the schema (e.g., 'provide one input image via base64 or file path') without adding significant new meaning.
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 verb (edit), resource (image), and method (prompt). It distinguishes from siblings like 'generate_image' and 'compose_images' by focusing on editing an existing image.
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 does not explicitly state when to use this tool vs. alternatives. While sibling names provide context, the description itself lacks explicit usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageB
Generate an image from a text prompt using Gemini 2.5 Flash Image
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Detailed scene description. Use photographic terms for photorealism. | |
| saveToFilePath | No | Optional path to save the image (png/jpeg by extension) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and description only restates the model name. Missing behavioral details like synchronicity, latency, rate limits, or cost implications.
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?
Single sentence that is front-loaded and to the point. Could include more detail without being verbose, but no wasted words.
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?
No output schema, no description of return value (e.g., URL, base64). Lacks context on capabilities of the model or when to prefer this over siblings.
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 covers 100% of parameters. Description adds value by suggesting 'use photographic terms for photorealism' for prompt, and clarifying file extension for saveToFilePath.
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?
Description clearly states action ('generate'), resource ('image'), and method ('from text prompt using Gemini 2.5 Flash Image'). Distinguishes from sibling tools (compose, edit, style transfer).
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?
No guidance on when to use this tool vs siblings like compose_images or edit_image. No when-not or alternative scenarios mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
style_transferB
Transfer style from a style image to a base image, guided by an optional prompt.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | No | Optional additional instruction for the style transfer. | |
| baseImage | Yes | ||
| styleImage | Yes | ||
| saveToFilePath | No | Optional path to save the output |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It only states that style is transferred, but omits important details such as potential image size/resolution constraints, output format, and whether the operation is deterministic or requires significant computation. This is insufficient for an AI agent to anticipate side effects.
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?
The description is a single, well-structured sentence that efficiently conveys the core function. Every word contributes to understanding, with no unnecessary elaboration.
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?
Despite moderate complexity (4 parameters, nested images, no output schema), the description fails to provide adequate context. It does not specify the output format (e.g., generated image returned inline or saved to path), behavior when prompt is omitted, or any error conditions. This leaves significant gaps for an AI agent.
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 coverage is 50% (prompt and saveToFilePath have descriptions; baseImage and styleImage do not). The tool description adds no additional parameter meaning beyond the schemaβit merely restates 'optional prompt'. Given the presence of nested image objects without detailed parameter descriptions, the description should have clarified expected image formats or requirements.
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 uses a specific verb ('transfer') and clearly identifies the resources ('style image', 'base image'), making the tool's function unambiguous. It also distinguishes this tool from siblings like 'compose_images' or 'edit_image' by explicitly mentioning style transfer.
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 implies the tool should be used for style transfer tasks, but it does not provide explicit guidance on when to use this tool versus alternatives (e.g., compose_images, edit_image). No usage restrictions or prerequisites are mentioned.
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.
4 tool updates
v0.1.7- First observed
compose_images - First observed
edit_image - First observed
generate_image - First observed
style_transfer
TDQS
Each tool targets a distinct image operation: generating from scratch, editing, composing multiple images, and style transfer. No overlap in functionality.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., compose_images, edit_image). No deviations.
Four tools cover essential image generation capabilities without being sparse or overloaded. The scope is well-balanced.
Core image workflows (generation, editing, composition, style transfer) are covered. Minor gaps like cropping or deletion exist but are non-essential for the server's purpose.
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
- lightgenOAuthapp.lightgen
Generate and edit images and create short videos inside Claude. Prepaid credits, no subscription.
LLM chat, text tools, image generation, editing and batch image jobs
Generate AI images, videos, music, SFX & speech in any AI assistant. Results appear inline in chat.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude Desktop users to generate and edit high-quality images using Google's Gemini AI. Supports text-to-image generation, image transformations with text prompts, and automatic local saving with multilingual support.31MIT
- AlicenseAqualityDmaintenanceEnables conversational image generation and editing with Google's Gemini 2.5 Flash Image Preview. Supports text-to-image generation, natural language image editing, multi-image composition, and style transfer with optional file saving.4123MIT
- AlicenseNot gradedqualityNot gradedmaintenanceGenerates AI images using Google Imagen directly in Claude Desktop, with automatic saving and support for multiple images and custom aspect ratios.-
- AlicenseNot gradedqualityDmaintenanceEnables generating, editing, and manipulating images using Google Gemini Flash 2.5 through natural language prompts. Supports text-to-image generation, image editing, multi-image composition, and batch processing with direct file management.1044MIT
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/Junhan2/gemini-nanobanana-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server