JG

junhan2/gemini-nanobanana-mcp

Developer tools
11 stars 5 forks Quality 67 Trend 18MIT

MCP server for Google Gemini 2.5 Flash Image preview (text-to-image, editing, composition)

Overview

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. 1. Visit Google AI Studio 2. Sign in with your Google account 3. Click "Create API key" → Copy the key 1. Open 2. Copy this code and replace YOUR_API_KEY with your actual key: 3. Save as: %APPDATA%/Claude/claude_desktop_config.json 4. 1. Open (search "Terminal" in Spotlight) 2. Run this command (replace YOUR_API_KEY): Just run this one command in your terminal (replace YOUR_API_KEY): 1. Go to Cursor Settings → MCP → Add new MCP Server 2. Fill in: - : gemini-nanobanana-mcp - : npx - : gemini-nanobanana-mcp@latest - : GEMINI_API_KEY = YOUR_API_KEY 3.

README

🎨 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)

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Click “Create API key” → Copy the key

2️⃣ Install in Your Claude Client (2 minutes)

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/


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: PNG

Custom Save Location

You: Create a sunset landscape and save it as ./my-sunset.png
Claude: Image saved to: ./my-sunset.png

What 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


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.sh

What 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


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


💡 Need Help?


🤝 Contributing

Found a bug? Have a feature idea? Contributions are welcome!

  1. Fork the repository
  2. Create your feature branch
  3. Make your changes
  4. 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

View the full README on GitHub

Install

npx gemini-nanobanana-mcp@latest
New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "gemini-nanobanana-mcp": { "command": "npx", "args": ["gemini-nanobanana-mcp@latest"], "env": { "GEMINI_API_KEY": "YOUR_API_KEY" } } } }