Skip to main content
Glama
Nanobanana MCP Server
by Porkbutts

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

Installation

npm install
npm run build

Configuration

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 generate

  • output_path (required): File path to save the generated image

  • model (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 reflections

nanobanana_edit_image

Edit an existing image using a text prompt.

Parameters:

  • prompt (required): Description of the edit to apply

  • image_path (required): File path to the image to edit (PNG, JPEG, WebP, or GIF)

  • output_path (required): File path to save the edited image

  • model (optional): Gemini model to use

Example:

Change the car color from blue to red

nanobanana_list_models

List available Gemini models for image generation.

Parameters:

  • response_format (optional): Output format - markdown or json (default: markdown)

Development

# Watch mode with auto-reload
npm run dev

# Build
npm run build

# Run
npm start

License

MIT

Available Tools

3 tools
nanobanana_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 ModelsA
Read-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

    A3.7/5.0

    Scored across 3 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    Related MCP Servers