Skip to main content
Glama

Nano Banana Pro MCP Server

License: MIT MCP

An MCP (Model Context Protocol) server that brings Google Gemini 2.0 Flash native image generation capabilities directly into Claude Code and other MCP-compatible AI assistants.

Generate, edit, and compose images using natural language - all without leaving your coding environment.

Features

  • Generate Images: Create high-quality images from text prompts (up to 4K resolution)

  • Edit Images: Modify existing images with text instructions

  • Continue Editing: Iteratively refine the last generated image

  • Compose Images: Combine up to 14 reference images into new compositions

  • Google Search Grounding: Generate images based on real-time information

  • Multiple Aspect Ratios: Support for 1:1, 16:9, 9:16, 4:3, 3:4, and more

  • High Resolution: Output at 1K, 2K, or 4K resolution

Related MCP server: Gemini Nanobanana MCP

Prerequisites

Quick Start

1. Build the Docker Image

cd nano-banana-pro-mcp
docker build -t nano-banana-pro-mcp .

2. Create Output Directory

mkdir -p output input

3. Add to Claude Code

Add the MCP server to Claude Code using one of these methods:

claude mcp add nano-banana-pro \
  --transport stdio \
  -- docker run -i --rm \
    -e GEMINI_API_KEY=$GEMINI_API_KEY \
    -v $(pwd)/output:/output \
    -v $(pwd)/input:/input:ro \
    nano-banana-pro-mcp

Option B: Manual Configuration

Add to your Claude Code MCP configuration file (~/.claude/claude_desktop_config.json or similar):

{
  "mcpServers": {
    "nano-banana-pro": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "GEMINI_API_KEY",
        "-v", "/path/to/output:/output",
        "-v", "/path/to/input:/input:ro",
        "nano-banana-pro-mcp"
      ],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Available Tools

generate_image

Generate a new image from a text prompt.

Parameters:

  • prompt (required): Text description of the image to create

  • aspectRatio (optional): 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

  • resolution (optional): 1K, 2K, or 4K

  • useGoogleSearch (optional): Enable real-time information grounding

Example:

Generate a professional hero image for a tech startup website, showing a
modern office with developers collaborating, 16:9 aspect ratio, 2K resolution

edit_image

Edit an existing image with text instructions.

Parameters:

  • imagePath (required): Path to the image file

  • prompt (required): Description of the modifications

  • referenceImages (optional): Array of reference image paths

  • aspectRatio (optional): Output aspect ratio

  • resolution (optional): Output resolution

Example:

Edit /input/logo.png - Change the background color to gradient blue and
add a subtle glow effect around the text

continue_editing

Continue editing the last generated/edited image.

Parameters:

  • prompt (required): Description of additional modifications

  • referenceImages (optional): Reference images for style transfer, etc.

  • aspectRatio (optional): Output aspect ratio

  • resolution (optional): Output resolution

Example:

Make the colors more vibrant and add a subtle drop shadow

compose_images

Combine multiple images into a new composition.

Parameters:

  • images (required): Array of image paths (up to 14)

  • prompt (required): How to combine the images

  • aspectRatio (optional): Output aspect ratio

  • resolution (optional): Output resolution

Example:

Compose these product photos into a professional catalog layout
with consistent lighting and white background

get_last_image_info

Get information about the last generated image.

get_configuration_status

Check if the API key is configured.

Tips for Best Results

  1. Be Descriptive: The more detail in your prompt, the better the result

  2. Use Photography Terms: For realistic images, mention camera angles, lens types, lighting

  3. Iterate: Use continue_editing to refine images step by step

  4. Reference Images: Use up to 14 reference images for character consistency or style transfer

  5. Google Search: Enable for real-time data like weather, news, or current events

Output Location

Generated images are saved to the /output directory (mounted from ./output on your host).

Troubleshooting

"GEMINI_API_KEY not set"

Make sure your API key is set in your environment:

export GEMINI_API_KEY="your-key-here"

Images not appearing

Check the ./output directory on your host machine. Ensure the volume mount is correct.

Docker permission issues

On Linux, you may need to run:

sudo chown -R $USER:$USER output

Development

To run locally without Docker:

npm install
npm run build
GEMINI_API_KEY=your-key OUTPUT_DIR=./output npm start

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Acknowledgments

Available Tools

6 tools
compose_imagesA

Combine multiple images into a new composition. Perfect for product mockups, character consistency, and creative collages. Supports up to 14 reference images.

ParametersJSON Schema
NameRequiredDescriptionDefault
imagesYesArray of file paths to images to combine (up to 14 images).
promptYesText describing how to combine the images and what to create.
aspectRatioNoAspect ratio for the output image.
resolutionNoOutput resolution.

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of disclosing behavioral traits. It only mentions the image limit (up to 14) but does not disclose whether the tool is read-only, destructive, modifies originals, or has any side effects. This is insufficient for an agent to understand the tool's behavior.

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 extremely concise with only two sentences, no redundant information, and front-loaded with the core action. Every word serves a purpose.

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

Completeness3/5

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

Given no output schema and no annotations, the description covers the basic purpose and a limit, but omits details about return values, error conditions, or any behavioral side effects. For a tool with 4 parameters, it is adequate but not fully complete.

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%, and the parameter descriptions in the schema are self-explanatory. The description adds minimal value beyond the schema, such as the 14-image limit, but does not explain parameter interactions or provide additional context for the 'prompt' or 'aspectRatio' fields.

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 ('combine multiple images'), the resource ('images into a new composition'), and provides specific use cases (product mockups, character consistency, creative collages). It also notes the limit of 14 images, distinguishing it from sibling tools like edit_image or generate_image.

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 for composition tasks via examples ('Perfect for product mockups...'), but does not explicitly state when to use this tool over alternatives or mention any prerequisites. There is no guidance on when not to use it.

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

continue_editingA

Continue editing the last generated/edited image in this session. Use for iterative improvements without specifying the file path.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesText describing the modifications to make to the last image.
referenceImagesNoOptional array of file paths to reference images.
aspectRatioNoAspect ratio for the output image.
resolutionNoOutput resolution.

TDQS

A4.1/5.0
Behavior3/5

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

No annotations provided, so description bears full burden. Describes stateful behavior (operates on last image) but lacks details on whether it overwrites or creates new, what happens if no image exists, or other side effects.

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?

Two sentences, front-loaded with action ('Continue editing...'), no unnecessary words. Every phrase earns its place.

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

Completeness3/5

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

Adequate for a simple tool with good schema coverage, but lacks behavioral details (e.g., error states, mutability) and does not reference sibling tools for when-not-to-use. With no output schema or annotations, additional context would be helpful.

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

Parameters4/5

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

Schema coverage is 100% with descriptions. The description adds value by clarifying the 'without specifying file path' aspect, which explains why there is no file path parameter and emphasizes the stateful context.

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?

Clearly states verb 'continue editing' and resource 'last generated/edited image in this session'. Distinguishes from sibling tools by mentioning no file path needed, implying it's for iterative improvements on the most recent image.

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?

Explicitly says 'use for iterative improvements without specifying the file path', giving clear context for when to use. However, no explicit when-not-to-use or alternative tool references, though sibling names suggest alternatives.

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

edit_imageB

Edit an existing image file using text instructions. Can add/remove elements, change styles, transfer styles from reference images, and more.

ParametersJSON Schema
NameRequiredDescriptionDefault
imagePathYesFull file path to the image to edit.
promptYesText describing the modifications to make to the image.
referenceImagesNoOptional array of file paths to reference images (for style transfer, adding elements, etc.). Up to 14 images supported.
aspectRatioNoAspect ratio for the output image.
resolutionNoOutput resolution.

TDQS

B3.1/5.0
Behavior2/5

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

No annotations provided so description must fully disclose behavior. Mentions editing but does not explain whether original file is overwritten, what happens on failure, or any other side effects.

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

Conciseness4/5

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

Efficient single sentence with bullet-like examples. Clear and front-loaded, but could be slightly more structured (e.g., separate actions from uses).

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

Completeness2/5

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

Description covers what the tool does but omits output specification (e.g., where edited image is saved) and behavioral details. Missing completeness for a mutation tool with no output schema.

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 coverage is 100% with clear parameter descriptions. Description adds little beyond listing capabilities, providing no extra semantic detail for parameters.

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?

Description clearly states action (edit), resource (existing image file), and lists specific capabilities (add/remove elements, change styles, style transfer). Distinguishes from siblings like compose_images and generate_image.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool vs siblings. Lacks context like prerequisites (e.g., image must exist) or when to prefer continue_editing.

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

generate_imageA

Generate a NEW image from text prompt using Gemini 3 Pro. Use this for creating completely new images from scratch. Supports high-resolution output (1K, 2K, 4K) and various aspect ratios.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesText prompt describing the image to create. Be descriptive and specific for best results.
aspectRatioNoAspect ratio for the generated image. Default is 1:1.
resolutionNoOutput resolution. Default is 1K. Higher resolutions take longer.
useGoogleSearchNoEnable Google Search grounding for real-time information (weather, news, etc.).

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses the model (Gemini 3 Pro), support for resolutions and aspect ratios, and that higher resolutions take longer. However, it lacks details on output format, potential failures, or any destructive effects.

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?

Two sentences, no unnecessary words. Every sentence adds value: first states primary function and model, second explains use case and highlights key features.

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?

For a straightforward image generation tool with no output schema and no annotations, the description covers purpose, supported options, and a usage hint. It could mention cost, rate limits, or maximum resolution, but is sufficient for basic operations.

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 coverage is 100% so baseline is 3. The description adds marginal context ('be descriptive and specific for best results' for prompt, 'Higher resolutions take longer' for resolution), which is helpful but not substantial 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?

Description explicitly states 'Generate a NEW image from text prompt' and 'Use this for creating completely new images from scratch,' which clearly identifies the action and distinguishes it from sibling tools like edit_image or continue_editing.

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 clearly indicates when to use this tool ('creating completely new images from scratch'), but does not explicitly provide when-not-to-use scenarios or mention alternatives.

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

get_configuration_statusA

Check if the Gemini API key is configured and ready to use.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

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

The description indicates a non-modifying check operation, which is consistent with its purpose. While no annotations are provided, the behavioral disclosure is sufficient for a zero-parameter, read-only tool.

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, concise sentence that front-loads the purpose without any superfluous details.

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

Completeness5/5

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

For a simple configuration check with no parameters and no output schema, the description provides all necessary context to understand the tool's function.

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

Parameters4/5

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

No parameters exist, and schema coverage is 100%. The description adds no parameter information, which is acceptable given the absence of parameters.

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 uses a specific verb ('check') and identifies the resource ('Gemini API key configuration'), clearly distinguishing from image-related sibling tools.

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 context (checking configuration) but does not explicitly state when to use this tool versus alternatives or provide any exclusion criteria.

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

get_last_image_infoA

Get information about the last generated/edited image in this session.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.6/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states a read operation but does not disclose what happens if no image exists, what information is returned, or any side effects. This leaves significant unknowns for an agent.

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 clear sentence, front-loading the essential purpose with no extraneous content. It is appropriately sized for its simplicity.

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

Completeness2/5

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

With no output schema and no annotations, the description lacks details on what information is returned. It mentions the context of the session but leaves the agent without knowledge of the return structure, which is important for a 'get' tool.

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

Parameters4/5

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

There are no parameters, and schema coverage is 100%. The description does not need to add parameter details, but it could have elaborated on the return format; however, for zero parameters, a baseline of 4 is appropriate.

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 verb 'Get information' and the specific resource 'last generated/edited image in this session', which distinguishes it from sibling tools like edit_image or generate_image.

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 when needing information about the last image in the current session, but does not provide explicit when-not or alternative tool guidance. The sibling tools cover distinct actions, so context is clear but no exclusions are given.

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. 6 tool updatesv1.0.0
    • First observedcompose_images
    • First observedcontinue_editing
    • First observededit_image
    • First observedgenerate_image
    • First observedget_configuration_status
    • First observedget_last_image_info

TDQS

A4/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: composing multiple images, continuing edits on the last image, editing a specified image, generating new images, checking API configuration, and retrieving info about the last image. No overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case (e.g., compose_images, generate_image, get_configuration_status). The naming is predictable and clear.

Tool Count5/5

With 6 tools, the server is well-scoped for image generation and editing tasks. Each tool serves a necessary function without redundancy or excessive complexity.

Completeness5/5

The tool set covers the core image lifecycle: create (generate_image), edit (edit_image), composite (compose_images), iterative refinement (continue_editing), status check, and information retrieval. No obvious gaps for the intended purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers