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.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesDescriptive text prompt for generating the image
save_pathNoOptional path to save the JPEG image. Supports absolute or relative paths. If omitted, the server saves to IMAGE_OUTPUT_DIR or a default local output directory.

Output Schema

ParametersJSON Schema
NameRequiredDescription
textNoOptional text response from the model
modelYesGemini model used for generation
file_pathYesAbsolute path where the generated image was saved
mime_typeYesMIME type for generated image bytes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate the tool is not read-only and has side effects. The description adds context by naming the external service (Google Gemini) and the side effect of saving a JPEG to disk. It also clarifies the output format, going beyond what annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is directly relevant and front-loaded with the main action. It avoids unnecessary detail and clearly communicates the purpose and key behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 parameters, output schema present, annotations provided), the description is sufficiently complete. It mentions the key side effect (saving to disk) and the technology (Gemini). A minor gap is the lack of any error handling or rate-limit information, but this is not critical for a straightforward generation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides full descriptions for both 'prompt' and 'save_path', covering 100% of parameters. The description itself does not add extra semantics about parameters beyond what is in the schema, so it aligns with the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Generate an image from a text prompt using Google Gemini') and the output ('save the JPEG to disk'). It is specific and leaves no ambiguity about what the tool does. Even without siblings, it distinguishes itself by naming the model and output format.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly tells when to use this tool: whenever an image needs to be generated from a text prompt and saved to disk. It does not explicitly mention exclusions or alternatives because there are no sibling tools, so this is acceptable. It provides clear functional context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev1.0.0
    • First observedgenerate_image

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 issues

Related MCP Connectors

Related MCP Servers