Skip to main content
Glama

Contributors Forks Stargazers Issues MIT License PyPI version Downloads

About The Project

Banana Image MCP is a production-ready MCP (Model Context Protocol) server that enables Claude and other AI assistants to generate high-quality images using Google's latest Gemini image models.

Simply describe what you want, and Claude will create it — from quick concept sketches to stunning 4K professional artwork.

Why Banana Image MCP?

  • Zero Setup Complexity — Just add your API key and start generating

  • Production Ready — Built with FastMCP framework, fully tested, CI/CD enabled

  • Best Quality — Leverages Gemini's most advanced image models with 4K support

  • Smart Defaults — Intelligent model selection based on your prompts

  • Real-World Knowledge — Google Search grounding for accurate, factual images

Built With

  • Python

  • FastMCP

  • Google Gemini

  • uv

Related MCP server: Nano Banana MCP

Features

4K Ultra HD Output

Generate images up to 3840px with the Pro model. Perfect for professional work, marketing materials, and print-ready assets.

Dual Model Support

  • Flash: 2-3s, up to 1024px — for quick iterations

  • Pro: 5-8s, up to 4K — for final deliverables

Smart Model Selection

The server automatically picks the best model based on your prompt. Say "quick sketch" for Flash, or "4K professional" for Pro.

Google Search Grounding

Pro model uses real-world knowledge from Google Search to generate more accurate and factual images.

Flexible Aspect Ratios

Support for all common ratios: 1:1, 16:9, 9:16, 4:3, 3:2, 21:9 and more.

Natural Language Editing

Edit existing images with simple text commands like "make the sky more dramatic" or "remove the background".

Quick Start

Get up and running in under 2 minutes.

Prerequisites

Installation

Add to your Claude Desktop config file:

{
  "mcpServers": {
    "banana-image": {
      "command": "uvx",
      "args": ["banana-image-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Platform

Path

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Linux

~/.config/Claude/claude_desktop_config.json

When using uvx, packages are cached locally. To get the latest version:

# Clear the cache for this package
uv cache clean banana-image-mcp

# Then restart Claude Desktop

Or specify a version explicitly in your config:

"args": ["banana-image-mcp==1.0.1"]

The configuration is the same for other MCP-compatible clients. Just add the server config to your client's MCP configuration file.

Usage

Just ask Claude to generate images naturally:

"Generate a cute cat wearing a space suit"

"Create a professional product photo of a coffee cup, 4K quality"

"Make a 16:9 YouTube thumbnail about cooking"

"Edit this image: make the sky more dramatic"

Model Comparison

Model

Speed

Max Resolution

Best For

Gemini 2.5 Flash

2-3s

1024px

Quick drafts, iterations, prototypes

Gemini 3 Pro

5-8s

4K (3840px)

Final assets, marketing, professional work

The server defaults to Pro model for best quality. Control it with keywords:

Say this...

Model Used

"quick sketch", "draft", "prototype"

Flash

"4K", "professional", "high quality"

Pro

(default)

Pro

Parameters Reference

Parameter

Type

Default

Description

prompt

string

required

Image description

model_tier

string

"pro"

"flash", "pro", or "auto"

resolution

string

"4k"

"1k", "2k", "4k", "high"

aspect_ratio

string

-

"1:1", "16:9", "9:16", "4:3", "21:9", etc.

thinking_level

string

"high"

"low" or "high" (Pro only)

enable_grounding

bool

true

Enable Google Search grounding (Pro only)

n

int

1

Number of images (1-4)

negative_prompt

string

-

What to avoid in the image

Environment Variables

Variable

Required

Default

Description

GEMINI_API_KEY

Yes

-

Your Gemini API key

IMAGE_OUTPUT_DIR

No

~/banana-images

Where to save generated images

What You Can Create

Roadmap

  • 4K resolution output (up to 3840px)

  • Dual model support (Flash + Pro)

  • Google Search grounding

  • Flexible aspect ratios

  • Natural language image editing

  • GitHub Actions CI/CD

  • Batch image generation

  • Image-to-image transformation

  • Video generation support

  • Local model support (Ollama)

See the open issues for a full list of proposed features and known issues.

Development

# Clone the repository
git clone https://github.com/zengwenliang416/banana-image-mcp.git
cd banana-image-mcp

# Install dependencies
uv sync

# Run in development mode
fastmcp dev banana_image_mcp.server:create_app

# Run tests
pytest

# Lint and format
ruff check .
ruff format .

Contributing

Contributions make the open source community amazing. Any contributions you make are greatly appreciated.

  1. Fork the Project

  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)

  3. Commit your Changes (git commit -m 'Add some AmazingFeature')

  4. Push to the Branch (git push origin feature/AmazingFeature)

  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Wenliang Zeng - @zengwenliang416

Project Link: https://github.com/zengwenliang416/banana-image-mcp

Acknowledgments

Available Tools

4 tools
generate_imageGenerate or edit images (Multi-Model: Flash & Pro)A
Read-only

Generate new images or edit existing images using natural language instructions.

Supports multiple input modes:

  1. Pure generation: Just provide a prompt to create new images

  2. Multi-image conditioning: Provide up to 3 input images using input_image_path_1/2/3 parameters

  3. File ID editing: Edit previously uploaded images using Files API ID

  4. File path editing: Edit local images by providing single input image path

Automatically detects mode based on parameters or can be explicitly controlled. Input images are read from the local filesystem to avoid massive token usage. Returns both MCP image content blocks and structured JSON with metadata.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesClear, detailed image prompt. Include subject, composition, action, location, style, and any text to render. Use the aspect_ratio parameter to pin a specific canvas shape when needed.
nNoRequested image count (model may return fewer).
negative_promptNoThings to avoid (style, objects, text).
system_instructionNoOptional system tone/style guidance.
input_image_path_1NoPath to first input image for composition/conditioning
input_image_path_2NoPath to second input image for composition/conditioning
input_image_path_3NoPath to third input image for composition/conditioning
file_idNoFiles API file ID to use as input/edit source (e.g., 'files/abc123'). If provided, this takes precedence over input_image_path_* parameters for the primary input.
modeNoOperation mode: 'generate' for new image creation, 'edit' for modifying existing images. Auto-detected based on input parameters if not specified.auto
model_tierNoModel tier: 'flash' (speed, 1024px), 'pro' (quality, up to 4K), or 'auto' (smart selection). Default: 'pro' - uses Pro model for best quality.pro
resolutionNoOutput resolution: '4k', '2k', '1k', 'high'. 4K is default for Pro model. Use 'flash' model_tier for faster 1K outputs.4k
thinking_levelNoReasoning depth for Pro model: 'low' (faster), 'high' (better quality). Only applies to Pro model. Default: 'high'.high
enable_groundingNoEnable Google Search grounding for factual accuracy (Pro model only). Useful for real-world subjects. Default: true.
aspect_ratioNoOptional output aspect ratio (e.g., '16:9'). See docs for supported values: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.

TDQS

A3.6/5.0
Behavior1/5

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

The description claims 'edit existing images' which contradicts the readOnlyHint=true annotation, indicating a potential write operation. No disclosure of destructive effects or permissions. Annotation contradiction detected.

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?

Well-structured with bullet points, front-loaded with main purpose, and every sentence adds value. Concise yet comprehensive.

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?

Covers input modes, automatic detection, and return format. Lacks error handling details, but sufficient for given complexity. No output schema so return description is adequate.

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 detailed parameter descriptions. The description adds minimal extra value for parameters, so baseline 3 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 it generates or edits images using natural language, with specific subsections for different modes. It differentiates from sibling tools by focusing on image generation/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?

Lists four distinct input modes and mentions automatic mode detection, providing clear guidance on when to use each. Lacks explicit when-not-to-use or alternatives, but sibling tools are unrelated.

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

maintenanceMaintenance and cleanup operationsB
Read-only

Perform maintenance operations following workflows.md patterns.

Available operations:

  • cleanup_expired: Remove expired Files API entries from database

  • cleanup_local: Clean old local files based on age/LRU

  • check_quota: Check Files API storage usage vs. ~20GB budget

  • database_hygiene: Clean up database inconsistencies

  • full_cleanup: Run all cleanup operations in sequence

ParametersJSON Schema
NameRequiredDescriptionDefault
operationYesMaintenance operation to perform: 'cleanup_expired', 'cleanup_local', 'check_quota', 'database_hygiene', 'full_cleanup'
dry_runNoIf true, only report what would be done without making changes
max_age_hoursNoFor local cleanup: maximum age in hours (default: 168 = 1 week)
keep_countNoFor local cleanup: minimum number of recent files to keep

TDQS

B3.4/5.0
Behavior2/5

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

The description states the tool performs maintenance operations (including destructive actions like cleanup), but annotations include readOnlyHint=true, creating a contradiction. The tool's mutability is not clarified, and the reference to workflows.md patterns is vague.

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 concise, with a clear opening sentence and a bullet list of operations. It front-loads the purpose and avoids unnecessary words.

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?

The tool has no output schema, and the description does not explain what the tool returns (e.g., reports, status messages). It also omits details about error handling or sequencing of full_cleanup.

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%, so the input schema already provides detailed descriptions for all parameters. The description adds the operation list but does not provide additional meaning beyond what the schema offers.

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 performs maintenance operations and lists specific operations like cleanup_expired, check_quota, etc. It distinguishes itself from siblings (generate_image, show_output_stats, upload_file) by focusing on maintenance tasks.

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?

While the description mentions following workflows.md patterns, it does not explicitly state when to use this tool versus alternatives. The operations are self-explanatory, but there is no guidance on exclusions or conditions for use.

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

show_output_statsShow output directory statsA
Read-only

Show statistics about the output directory and recently generated images.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint: true, and the description adds that it shows stats and recently generated images. No contradiction; the description appropriately complements the annotations for a 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, well-structured sentence that conveys the tool's purpose without waste. Every word earns its place.

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 simple stat tool with no parameters or output schema, the description is adequate. It could list specific statistics, but given low complexity, it is sufficiently complete.

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?

The input schema has no parameters, so schema coverage is 100%. Baseline score of 4 is appropriate; no parameter documentation is needed.

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 'show' and resource 'statistics about the output directory and recently generated images', clearly differentiating it from sibling tools like generate_image (creates images) and maintenance (presumably maintenance tasks). It is unambiguous and sets clear expectations.

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?

While the description implies the tool is for viewing output stats, it does not explicitly state when to use it versus siblings or provide exclusions. The usage context is inferred but not guided.

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

upload_fileUpload file to Gemini Files APIA

Upload a local file through the Gemini Files API and return its URI & metadata. Useful when the image is larger than 20MB or reused across prompts.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesServer-accessible file path to upload to Gemini Files API.
display_nameNoOptional display name for the uploaded file.

TDQS

A4/5.0
Behavior3/5

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

Annotations (readOnlyHint=false, openWorldHint=true) already indicate a mutating, side-effectful operation. The description adds the outcome of returning URI and metadata but lacks details on permissions, error handling, or specific behavioral traits 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 two sentences long, front-loaded with the core purpose, and the second sentence adds a valuable usage hint. Every sentence is purposeful and there is no unnecessary information.

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 no output schema, the description adequately states the return type (URI and metadata). It covers the tool's purpose and usage context. Minor gaps exist regarding file type restrictions or error handling, but overall it is fairly complete for a simple upload 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 has 100% parameter description coverage, so the baseline is 3. The description does not add meaning beyond what the schema provides; the mention of 'image' in the usage hint slightly conflicts with the general 'file path' parameter, but not severely.

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 'upload', the resource 'local file through the Gemini Files API', and the outcome 'return its URI & metadata'. It effectively distinguishes from sibling tools like generate_image and maintenance, which have different purposes.

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 a specific use case: 'Useful when the image is larger than 20MB or reused across prompts.' This gives clear context for when to use the tool, though it does not explicitly state when not to use it or provide alternative tools.

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

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: generate_image for creating/editing images, maintenance for system cleanups, show_output_stats for monitoring, and upload_file for file uploads. There is no ambiguity between them.

Naming Consistency4/5

Most tool names follow a verb_noun pattern (generate_image, show_output_stats, upload_file). 'Maintenance' is a single noun but still clear and fits the overall style. Minor inconsistency does not cause confusion.

Tool Count5/5

Four tools is well-scoped for an image generation server. Each tool addresses a key aspect: generation, upload, maintenance, and statistics. The count is neither too few nor excessive.

Completeness4/5

The tools cover core image operations (generation, upload, maintenance, stats). A minor gap is the lack of a dedicated delete tool for images, but maintenance can clean up expired files, so it's workable.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zengwenliang416/banana-image-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server