Skip to main content
Glama

Nano Banana MCP Server

A local stdio MCP server for Gemini-powered image generation.

Features

  • Simple MCP to generate images with Google's Gemini image models

  • Save generated output to local disk as JPEG

  • Return both user-facing content and structured tool output for clients

  • Run locally via stdio (no HTTP transport in this project)

Related MCP server: Nano Banana MCP Server

Prerequisites

  • Node.js 20+

  • Gemini API key from Google AI Studio

Install

git clone https://github.com/priorwave/nano_banana_mcp_server/
cd nano-banana-mcp
npm install
npm run build

Configuration

Set an API key in your shell profile:

export GEMINI_API_KEY="your-key-here"
# GOOGLE_API_KEY is also supported

Optional model override:

export GEMINI_IMAGE_MODEL="gemini-2.5-flash-image"

Configure your MCP client to run this server locally via stdio:

{
  "mcpServers": {
    "nano-banana": {
      "command": "node",
      "args": ["/absolute/path/to/nano_banana_mcp_server/dist/index.js"],
      "env": {
        "GEMINI_API_KEY": "${GEMINI_API_KEY}"
      }
    }
  }
}

Tool: generate_image

Parameter

Required

Description

prompt

Yes

Prompt text for generation (1-4000 chars)

save_path

No

Optional output path (absolute or relative). If directory, a timestamped .jpg file is created. If file path, extension must be .jpg or .jpeg. If omitted or invalid/unwritable, the server falls back to IMAGE_OUTPUT_DIR and then a safe local temp directory.

The tool returns:

  • Text status content

  • Image content

  • Structured output with file_path, mime_type, model, and optional text

Development

  • Build: npm run build

  • Start: npm start

  • Test: npm test

Available Tools

1 tool
generate_imageGenerate ImageA

Generate an image from a text prompt using Google Gemini and save the JPEG to disk.

Inputs: prompt (required), save_path. Returns: text, model, file_path, mime_type

Tool Schema Changelog

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

    TDQS

    A4.2/5.0

    Scored across 1 tool

    Disambiguation5/5

    Only one tool exists, so there is no possibility of confusing it with other tools. Its purpose is clearly defined.

    Naming Consistency5/5

    With a single tool, the naming is inherently consistent and follows a clear verb_noun pattern (generate_image).

    Tool Count3/5

    A single tool feels thin for a server, but it may be appropriate if the server's entire purpose is image generation. Still, it is borderline and likely lacks broader functionality.

    Completeness4/5

    The tool provides the core image generation capability with no obvious dead ends, though a more complete surface might include options like output path or resolution controls. Minor gaps exist but are workable.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers