Skip to main content
Glama

KOF Nano Banana MCP Server 🍌

MCP server for Gemini native image generation (Nano Banana). Part of the KeepOnFirst Agentic Workflow.

English | 繁體中文

⚠️ Important: Billing Required

Note: The Gemini API Free Tier does NOT support image generation models. To use this MCP server, you must provide an API key from a Google Cloud project with billing enabled.

Related MCP server: Gemini Image MCP

Features

  • Generate images using Gemini 2.5 Flash Image or Gemini 3 Pro Image

  • Process queue of prompt files with validation and dry-run support

  • YAML frontmatter support for prompt configuration

  • Cross-IDE compatible - works with any MCP-enabled client

β˜• Support this project

If this project helps you, you can support development here:

Installation

If you have published this package or use it locally:

{
  "mcpServers": {
    "nanobanana": {
      "command": "npx",
      "args": ["-y", "@keeponfirst/kof-nanobanana-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Option 2: Local Development

cd kof-nanobanana-mcp
npm install
npm run build

Then configure absolute path in your MCP config (see Configuration section).

Configuration

1. Get a Gemini API Key

  1. Go to Google AI Studio

  2. Create an API key

  3. IMPORTANT: Ensure your project has billing enabled. These models are paid-only.

2. Add to MCP Config

Add to your MCP configuration file (e.g., ~/.gemini/antigravity/mcp_config.json):

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

Tools

nanobanana_generate_image

Generate a single image.

Parameters:

Name

Type

Required

Description

prompt

string

βœ…

Image description (10-5000 chars)

output_path

string

βœ…

Path to save the image

model

string

❌

gemini-2.5-flash-image (default) or gemini-3-pro-image-preview

aspect_ratio

string

❌

1:1, 16:9, 9:16, 4:3, 3:4

overwrite

boolean

❌

Overwrite existing file (default: false)

Example:

{
  "prompt": "A modern flat illustration of three AI robots working together on code",
  "output_path": "assets/generated/workflow-hero.png",
  "model": "gemini-2.5-flash-image",
  "aspect_ratio": "16:9"
}

nanobanana_list_queue

List and validate prompt files in the queue.

Parameters:

Name

Type

Required

Description

queue_dir

string

❌

Queue directory (default: nanobanana/queue)

validate

boolean

❌

Validate files (default: true)

check_conflicts

boolean

❌

Check if outputs exist (default: true)

nanobanana_process_queue

Batch process all prompt files.

Parameters:

Name

Type

Required

Description

queue_dir

string

❌

Queue directory (default: nanobanana/queue)

validate_only

boolean

❌

Only validate, no generation

dry_run

boolean

❌

Preview without API calls

overwrite

string

❌

skip, overwrite, or rename

Prompt File Format

Create .md files in nanobanana/queue/ with YAML frontmatter:

---
output_path: assets/generated/workflow-hero.png
model: gemini-2.5-flash-image
aspect_ratio: 16:9
overwrite: false
---

# Workflow Hero Image

Create a modern, sleek hero illustration showing three AI agents
working together in a software development workflow.

## Style Guidelines
- Style: Flat illustration with gradients
- Color palette: Deep purple (#6B46C1) to blue (#3B82F6)
- Background: Subtle gradient

Pricing Reference

Model

Price per Image

Gemini 2.5 Flash Image

~$0.039 (1024x1024)

Gemini 3 Pro Image (2K)

~$0.134

Gemini 3 Pro Image (4K)

~$0.24

License

MIT

Available Tools

3 tools
nanobanana_generate_imageGenerate Image with Nano BananaA
Idempotent

Generate an image using Gemini's native image generation (Nano Banana).

This tool calls the Gemini API to generate an image based on your text prompt and saves it to the specified path.

Models:

  • gemini-2.5-flash-image: Fast, efficient (~$0.039/image)

  • gemini-3-pro-image-preview: Higher quality, supports 4K (~$0.134-0.24/image)

Supported Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4

Example:

prompt: "A modern flat illustration of a workflow diagram with three connected nodes, purple and blue gradient colors, minimal style"
output_path: "assets/generated/workflow-hero.png"
model: "gemini-2.5-flash-image"
aspect_ratio: "16:9"
ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesImage generation prompt describing the desired image
output_pathYesRelative or absolute path to save the generated image (e.g., 'assets/generated/hero.png')
modelNoGemini model to use. Flash for speed, Pro for qualitygemini-2.5-flash-image
aspect_ratioNoAspect ratio of the generated image
overwriteNoIf true, overwrite existing file. If false, skip if file exists

TDQS

A4/5.0
Behavior4/5

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

Annotations provide readOnlyHint=false, openWorldHint=true, idempotentHint=true, and destructiveHint=false. The description adds valuable context beyond annotations: it explains cost implications of different models, supported aspect ratios, and the file-saving behavior with overwrite option. This enhances understanding of the tool's operational characteristics.

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 efficiently structured with clear sections (overview, models, aspect ratios, example) and every sentence adds value. The example is particularly helpful for understanding usage without being verbose. The information is well-organized and front-loaded.

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 complexity of an image generation tool with 5 parameters and no output schema, the description provides good context about models, costs, aspect ratios, and file handling. However, it doesn't explain what the tool returns (e.g., success confirmation, error handling) or provide guidance on prompt engineering best practices.

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?

With 100% schema description coverage, the schema already documents all 5 parameters thoroughly. The description adds minimal additional semantic context through the example showing typical usage patterns, but doesn't provide significant new information beyond what's in the schema descriptions.

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 specific action ('Generate an image'), resource ('using Gemini's native image generation'), and distinguishes from siblings by focusing on image creation rather than queue management. It provides a concrete example that reinforces the purpose.

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

Usage Guidelines3/5

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

The description implies usage through the example and model descriptions, suggesting when to choose different models based on speed vs. quality. However, it doesn't explicitly state when to use this tool versus the queue-related siblings or provide clear exclusions or alternatives.

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

nanobanana_list_queueList Nano Banana QueueA
Read-onlyIdempotent

List and validate prompt files in the queue directory.

This tool scans the queue directory for markdown prompt files and provides:

  • Validation status for each file

  • Conflict detection (output file already exists)

  • Preview of prompt content

Use this to review what will be generated before running process_queue.

Example:

queue_dir: "nanobanana/queue"
validate: true
check_conflicts: true
ParametersJSON Schema
NameRequiredDescriptionDefault
queue_dirNoDirectory to scan for prompt filesnanobanana/queue
validateNoIf true, validate each prompt file and report errors
check_conflictsNoIf true, check if output files already exist

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds valuable behavioral context beyond annotations: it specifies the tool scans for markdown files, validates them, checks for output file conflicts, and provides previews. However, it doesn't mention rate limits or authentication needs.

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 well-structured and front-loaded: the first sentence states the core purpose, followed by bullet points detailing outputs, and ends with usage guidance and an example. Every sentence earns its place without redundancy.

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 moderate complexity, rich annotations, and 100% schema coverage, the description is mostly complete. It lacks an output schema, but the description outlines what the tool provides (validation status, conflict detection, preview). A minor gap is no explicit mention of error handling or output format details.

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?

Schema description coverage is 100%, with clear descriptions for all three parameters (queue_dir, validate, check_conflicts). The description adds minimal value beyond the schema, only implying parameter usage through the example. Baseline 3 is appropriate since the schema does the heavy lifting.

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 tool's purpose with specific verbs ('list and validate prompt files') and resources ('queue directory'), distinguishing it from siblings like 'nanobanana_generate_image' (which creates images) and 'nanobanana_process_queue' (which processes the queue). It explicitly mentions scanning markdown prompt files, validation, conflict detection, and content preview.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'Use this to review what will be generated before running process_queue.' This clearly distinguishes it from the sibling 'nanobanana_process_queue' and indicates it's for pre-processing inspection rather than execution.

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

nanobanana_process_queueProcess Nano Banana QueueA

Process all prompt files in the queue directory and generate images.

Modes:

  • validate_only=true: Only validate prompts, no API calls

  • dry_run=true: Show what would be generated, no API calls

  • Both false: Actually generate images

Overwrite Strategies:

  • skip: Skip if output file exists (default)

  • overwrite: Replace existing files

  • rename: Generate with suffix (e.g., hero_1.png)

After successful generation, prompt files are moved to completed_dir with timestamp.

Example:

queue_dir: "nanobanana/queue"
dry_run: true
overwrite: "skip"
ParametersJSON Schema
NameRequiredDescriptionDefault
queue_dirNoDirectory containing prompt markdown filesnanobanana/queue
output_dirNoDefault directory to save generated images (used if prompt has relative path)assets/generated
completed_dirNoDirectory to move processed prompts tonanobanana/completed
modelNoGemini model to use for all generations (overrides prompt settings)gemini-2.5-flash-image
validate_onlyNoIf true, only validate prompt files without generating images
dry_runNoIf true, show what would be generated without actually calling API
overwriteNoStrategy when output file exists: skip, overwrite, or rename with suffixskip

TDQS

A4.2/5.0
Behavior4/5

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

The description adds valuable behavioral context beyond annotations: it explains file movement ('prompt files are moved to completed_dir with timestamp'), operational modes, and overwrite strategies. Annotations cover basic hints (e.g., not read-only, not destructive), but the description enriches this with practical details like no API calls in certain modes. No contradictions with annotations exist.

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 well-structured and front-loaded with the core purpose, followed by organized sections for modes, overwrite strategies, and an example. Every sentence adds value, with no wasted words, making it efficient and easy to scan.

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 complexity (batch processing with multiple modes and file operations) and lack of an output schema, the description does a good job covering behavior, parameters, and usage. However, it could improve by mentioning error handling or output format details, which would be needed for full completeness in this context.

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?

With 100% schema description coverage, the input schema already documents all parameters thoroughly. The description adds minimal extra semantics, such as clarifying that 'output_dir' is used 'if prompt has relative path' and providing an example with parameter values. This meets the baseline for high schema coverage but doesn't significantly enhance understanding beyond the schema.

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 tool's purpose: 'Process all prompt files in the queue directory and generate images.' This specifies the verb ('process'), resource ('prompt files'), and outcome ('generate images'), distinguishing it from sibling tools like 'nanobanana_generate_image' (single generation) and 'nanobanana_list_queue' (listing only).

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 provides clear context for when to use the tool by detailing three operational modes (validate_only, dry_run, full generation) and overwrite strategies. However, it does not explicitly state when to use this batch processing tool versus the sibling 'nanobanana_generate_image' for single generations, which would be needed for a perfect score.

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. 3 tool updatesv1.0.0
    • First observednanobanana_generate_image
    • First observednanobanana_list_queue
    • First observednanobanana_process_queue

TDQS

A4.3/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: generate_image creates individual images, list_queue inspects pending files, and process_queue batch processes the queue. The descriptions reinforce these separate functions, making misselection unlikely.

Naming Consistency5/5

All tools follow a perfect verb_noun pattern with the 'nanobanana_' prefix: generate_image, list_queue, process_queue. This consistent naming convention makes the tool set predictable and easy to understand.

Tool Count5/5

Three tools is ideal for this server's focused scope of image generation queue management. Each tool earns its place by covering distinct aspects of the workflow: single generation, queue inspection, and batch processing.

Completeness4/5

The tool set covers the core image generation workflow well with generation, inspection, and processing capabilities. A minor gap exists in not providing tools for managing completed images or modifying queue entries, but agents can work around this with file system operations.

Related MCP Connectors

Related MCP Servers