Nano-Banana (Gemini 2.5 Flash Image)

Nano-Banana (Gemini 2.5 Flash Image)

conechoai

Connects to Google's Gemini 2.5 Flash API to generate and edit images from text prompts. Supports iterative editing workflows and automatically saves images with organized file management.

Integrates with Google's Gemini 2.5 Flash to generate and edit images from text prompts, supporting iterative workflows with reference images and automatic cross-platform file management.

112672 views54Local (stdio)

What it does

  • Generate images from text descriptions
  • Edit existing images with text prompts
  • Continue iterative editing on previous images
  • Use reference images for style transfer
  • Save images automatically with organized naming

Best for

Content creators needing quick image generationIterative design workflows and prototypingAI-assisted image editing and modifications
Cross-platform file managementMultiple reference image supportIterative editing workflows

About Nano-Banana (Gemini 2.5 Flash Image)

Nano-Banana (Gemini 2.5 Flash Image) is a community-built MCP server published by conechoai that provides AI assistants with tools and capabilities via the Model Context Protocol. Generate and edit images from text with Nano-Banana, an AI image generator powered by Gemini 2.5 Flash. Fast, seamless, It is categorized under ai ml.

How to install

You can install Nano-Banana (Gemini 2.5 Flash Image) in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Nano-Banana (Gemini 2.5 Flash Image) is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Nano-Banana MCP Server 🍌

πŸ€– This project was entirely generated by Claude Code - an AI coding assistant that can create complete, production-ready applications from scratch.

A Model Context Protocol (MCP) server that provides AI image generation and editing capabilities using Google's Gemini 2.5 Flash Image API. Generate stunning images, edit existing ones, and iterate on your creations with simple text prompts.

Nano-Banana-MCP MCP server

✨ Features

  • 🎨 Generate Images: Create new images from text descriptions
  • ✏️ Edit Images: Modify existing images with text prompts
  • πŸ”„ Iterative Editing: Continue editing the last generated/edited image
  • πŸ–ΌοΈ Multiple Reference Images: Use reference images for style transfer and guidance
  • 🌍 Cross-Platform: Smart file paths for Windows, macOS, and Linux
  • πŸ”§ Easy Setup: Simple configuration with API key
  • πŸ“ Auto File Management: Automatic image saving with organized naming

πŸ”‘ Setup

  1. Get your Gemini API key:

  2. Configure the MCP server: See configuration examples for your specific client below (Claude Code, Cursor, or other MCP clients).

πŸ’» Usage with Claude Code

Configuration:

Add this to your Claude Code MCP settings:

Option A: With environment variable (Recommended - Most Secure)

{
  "mcpServers": {
    "nano-banana": {
      "command": "npx",
      "args": ["nano-banana-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  }
}

Option B: Without environment variable

{
  "mcpServers": {
    "nano-banana": {
      "command": "npx",
      "args": ["nano-banana-mcp"]
    }
  }
}

Usage Examples:

Generate an image of a sunset over mountains
Edit this image to add some birds in the sky
Continue editing to make it more dramatic

🎯 Usage with Cursor

Configuration:

Add to your Cursor MCP configuration:

Option A: With environment variable (Recommended)

{
  "nano-banana": {
    "command": "npx",
    "args": ["nano-banana-mcp"],
    "env": {
      "GEMINI_API_KEY": "your-gemini-api-key-here"
    }
  }
}

Option B: Without environment variable

{
  "nano-banana": {
    "command": "npx",
    "args": ["nano-banana-mcp"]
  }
}

Usage Examples:

  • Ask Cursor to generate images for your app
  • Create mockups and prototypes
  • Generate assets for your projects

πŸ”§ For Other MCP Clients

If you're using a different MCP client, you can configure nano-banana-mcp using any of these methods:

Configuration Methods

Method A: Environment Variable in MCP Config (Recommended)

{
  "nano-banana": {
    "command": "npx",
    "args": ["nano-banana-mcp"],
    "env": {
      "GEMINI_API_KEY": "your-gemini-api-key-here"
    }
  }
}

Method B: System Environment Variable

export GEMINI_API_KEY="your-gemini-api-key-here"
npx nano-banana-mcp

Method C: Using the Configure Tool

npx nano-banana-mcp
# The server will prompt you to configure when first used
# This creates a local .nano-banana-config.json file

πŸ› οΈ Available Commands

generate_image

Create a new image from a text prompt.

generate_image({
  prompt: "A futuristic city at night with neon lights"
})

edit_image

Edit a specific image file.

edit_image({
  imagePath: "/path/to/image.png",
  prompt: "Add a rainbow in the sky",
  referenceImages?: ["/path/to/reference.jpg"] // optional
})

continue_editing

Continue editing the last generated/edited image.

continue_editing({
  prompt: "Make it more colorful",
  referenceImages?: ["/path/to/style.jpg"] // optional
})

get_last_image_info

Get information about the last generated image.

get_last_image_info()

configure_gemini_token

Configure your Gemini API key.

configure_gemini_token({
  apiKey: "your-gemini-api-key"
})

get_configuration_status

Check if the API key is configured.

get_configuration_status()

βš™οΈ Configuration Priority

The MCP server loads your API key in the following priority order:

  1. πŸ₯‡ MCP Configuration Environment Variables (Highest Priority)

    • Set in your claude_desktop_config.json or MCP client config
    • Most secure as it's contained within the MCP configuration
    • Example: "env": { "GEMINI_API_KEY": "your-key" }
  2. πŸ₯ˆ System Environment Variables

    • Set in your shell/system environment
    • Example: export GEMINI_API_KEY="your-key"
  3. πŸ₯‰ Local Configuration File (Lowest Priority)

    • Created when using the configure_gemini_token tool
    • Stored as .nano-banana-config.json in current directory
    • Automatically ignored by Git and NPM

πŸ’‘ Recommendation: Use Method 1 (MCP config env variables) for the best security and convenience.

πŸ“ File Storage

Images are automatically saved to platform-appropriate locations:

  • Windows: %USERPROFILE%\\Documents\\nano-banana-images\\
  • macOS/Linux: ./generated_imgs/ (in current directory)
  • System directories: ~/nano-banana-images/ (when run from system paths)

File naming convention:

  • Generated images: generated-[timestamp]-[id].png
  • Edited images: edited-[timestamp]-[id].png

🎨 Example Workflows

Basic Image Generation

  1. generate_image - Create your base image
  2. continue_editing - Refine and improve
  3. continue_editing - Add final touches

Style Transfer

  1. generate_image - Create base content
  2. edit_image - Use reference images for style
  3. continue_editing - Fine-tune the result

Iterative Design

  1. generate_image - Start with a concept
  2. get_last_image_info - Check current state
  3. continue_editing - Make adjustments
  4. Repeat until satisfied

πŸ”§ Development

This project was created with Claude Code and follows these technologies:

  • TypeScript - Type-safe development
  • Node.js - Runtime environment
  • Zod - Schema validation
  • Google GenAI - Image generation API
  • MCP SDK - Model Context Protocol

Local Development

# Clone the repository
git clone https://github.com/claude-code/nano-banana-mcp.git
cd nano-banana-mcp

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build for production
npm run build

# Run tests
npm test

πŸ“‹ Requirements

  • Node.js 18.0.0 or higher
  • Gemini API key from Google AI Studio
  • Compatible with Claude Code, Cursor, and other MCP clients

🀝 Contributing

This project was generated by Claude Code, but contributions are welcome! Please feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests
  • Improve documentation

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • Claude Code - For generating this entire project
  • Google AI - For the powerful Gemini 2.5 Flash Image API
  • Anthropic - For the Model Context Protocol
  • Open Source Community - For the amazing tools and libraries

πŸ“ž Support


✨ Generated with love by Claude Code - The future of AI-powered development is here!

Alternatives

Related Skills

Browse all skills
nanobanana-skill

Generate or edit images using Google Gemini API via nanobanana. Use when the user asks to create, generate, edit images with nanobanana, or mentions image generation/editing tasks.

6
gemini-tg-image-gen

Generate images via OpenRouter (google/gemini-2.5-flash-image) and send to Telegram. Use when user asks for AI-generated images in TG.

1
nanobanana-pro-fallback

Generate or edit images via Gemini Image API with automatic model fallback.

1
nano-banana-pro

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

666
gemini-imagegen

Generate and edit images using the Gemini API (Nano Banana Pro). Use this skill when creating images from text prompts, editing existing images, applying style transfers, generating logos with text, creating stickers, product mockups, or any image generation/manipulation task. Supports text-to-image, image editing, multi-turn refinement, and composition from multiple reference images.

16
generate-image

Generate or edit images using AI models (FLUX, Gemini). Use for scientific illustrations, diagrams, schematics, infographics, concept visualizations, and artistic images. Supports image editing to modify existing images (change colors, add/remove elements, style transfer). Useful for figures, posters, and visual explanations.

11