Skip to main content
Glama
Nano Banana MCP Server

Nano Banana MCP Server

by Lennix

Nano Banana MCP Server

An MCP (Model Context Protocol) server for AI image generation using Google's Nano Banana 2 (Gemini 3.1 Flash Image) model. Works with Claude Code, Gemini CLI, and any MCP-compatible client.

Forked from gemini-cli-extensions/nanobanana (v1.0.11) by Google LLC, with added support for aspect ratio and image resolution control.

What's different from upstream

  • aspectRatio parameter: 1:1, 9:16, 16:9, 3:4, 4:3

  • imageSize parameter: 512px, 1K, 2K, 4K

  • Both passed to the Gemini API via imageConfig in generateContent

Related MCP server: Nano Banana

Tools

Tool

Description

generate_image

Text-to-image with styles, variations, aspect ratio, resolution

edit_image

Edit an existing image from a text prompt

restore_image

Enhance or repair an existing image

generate_icon

App icons, favicons, and UI elements

generate_pattern

Seamless patterns and textures

generate_story

Sequential visual narratives (2-8 steps)

generate_diagram

Flowcharts, architecture, wireframes

Setup

Prerequisites

Claude Code

Add to ~/.claude.json:

{
  "mcpServers": {
    "nanobanana": {
      "command": "node",
      "args": ["/path/to/mcp-server/dist/index.js"],
      "env": {
        "GEMINI_API_KEY": "your-api-key"
      }
    }
  }
}

Gemini CLI

Install as an extension:

gemini extensions install https://github.com/gemini-cli-extensions/nanobanana

Or point to this server in your settings.json:

{
  "mcpServers": {
    "nanobanana": {
      "command": "node",
      "args": ["/path/to/mcp-server/dist/index.js"],
      "env": {
        "GEMINI_API_KEY": "your-api-key"
      }
    }
  }
}

Usage examples

Generate a mountain landscape at sunset, 16:9, 2K resolution
Edit chill-original.png: remove all floating icons, keep only the person
Generate an app icon for a banana delivery service

Environment variables

Variable

Description

GEMINI_API_KEY

Your Gemini API key (required)

NANOBANANA_MODEL

Override the model (default: gemini-3.1-flash-image-preview)

Development

npm install
npm run build    # compile TypeScript
npm run dev      # watch mode
npm start        # run the server

License

Apache-2.0 -- see LICENSE.

Original work Copyright 2025 Google LLC. Modifications by lennix.

Available Tools

7 tools
edit_imageB

Edit an existing image based on a text prompt

Inputs: file (required), prompt (required), preview.

generate_diagramB

Generate technical diagrams, flowcharts, and architectural mockups

Inputs: prompt (required), type, style, colors, +4 more.

generate_iconB

Generate app icons, favicons, and UI elements in multiple sizes and formats

Inputs: prompt (required), type, sizes, style, +4 more.

generate_imageB

Generate single or multiple images from text prompts with style and variation options

Inputs: prompt (required), seed, format, styles, +5 more.

generate_patternB

Generate seamless patterns and textures for backgrounds and design elements

Inputs: prompt (required), size, type, style, +4 more.

generate_storyB

Generate a sequence of related images that tell a visual story or show a process

Inputs: prompt (required), type, steps, style, +4 more.

restore_imageC

Restore or enhance an existing image

Inputs: file (required), prompt (required), preview.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools are clearly differentiated by output type: icons, patterns, stories, and diagrams are specialized generation modes. The main overlap is between restore_image and edit_image, since both modify an existing image, but the descriptions distinguish enhancement/restoration from prompt-based editing.

    Naming Consistency5/5

    All seven tools follow a consistent snake_case verb_noun pattern: restore_image, edit_image, generate_image, generate_icon, generate_pattern, generate_story, and generate_diagram. The convention is predictable and easy to scan.

    Tool Count5/5

    Seven tools is well-scoped for an image generation and editing server. Each tool maps to a meaningful image workflow, and there are no obviously redundant entries.

    Completeness4/5

    The surface covers core image creation, editing, restoration, and several important specialized generation cases. Minor gaps may exist around image management operations such as listing or retrieving generated assets, but the creative workflow is largely complete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers