Skip to main content

A production-ready MCP server for AI-powered image generation using Gemini 3 Pro Image and Gemini 2.5 Flash Image with intelligent model selection

Project description

Banana Image MCP

MCP Image Generation

Let Claude Generate Stunning Images for You

PyPI version Downloads Python 3.11+ License: MIT

中文文档 | Report Issues


What is Banana Image MCP?

Banana Image MCP is an 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.

Key Features

Feature Description
4K Ultra HD Generate images up to 3840px with Pro model
Dual Model Support Flash (fast, 2-3s) + Pro (4K quality, 5-8s)
Smart Model Selection Automatically picks the best model based on your prompt
Google Search Grounding Pro model uses real-world knowledge for accuracy
Flexible Aspect Ratios 1:1, 16:9, 9:16, 4:3, 3:2, 21:9 and more
Image Editing Edit existing images with natural language
Advanced Reasoning Configurable thinking levels for complex compositions

Quick Start

1. Get a Gemini API Key

Get your free API key from Google AI Studio

2. Install & Configure

For Claude Desktop, add to your config file:

{
  "mcpServers": {
    "banana-image": {
      "command": "uvx",
      "args": ["banana-image-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}
Config file locations
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
Other MCP clients (Cursor, VS Code, Cline, etc.)

The configuration is similar for other MCP-compatible clients:

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

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

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

# Then restart your MCP client (Claude Desktop, etc.)

Or specify a version explicitly:

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

3. Start Creating

Just ask Claude to generate images:

"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"

Models 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

Model Selection

The server defaults to Pro model for best quality. You can also control it:

Say this... Model Used
"quick sketch", "draft", "prototype" Flash
"4K", "professional", "high quality" Pro
(default) Pro

Tool Parameters

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

Example Outputs

Here are some examples of what you can create:

  • Product Photography: Professional product shots with studio lighting
  • Concept Art: Fantasy landscapes, character designs, sci-fi scenes
  • Marketing Materials: Social media graphics, banners, thumbnails
  • Technical Diagrams: Flowcharts, architecture diagrams with text
  • Photo-realistic Images: Portraits, nature, urban photography

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 .

Changelog

v1.0.0

  • First stable release
  • 4K resolution output support (up to 3840px)
  • Dual model support: Flash (fast) + Pro (4K quality)
  • Intelligent model selection based on prompt
  • Google Search grounding for Pro model
  • Flexible aspect ratios (1:1, 16:9, 9:16, 4:3, 21:9, etc.)
  • Image editing with natural language
  • GitHub Actions CI/CD workflow

v0.1.2

  • Added 4K resolution output support
  • Default to Pro model and 4K resolution
  • Fixed image_size parameter passing to Gemini API

v0.1.1

  • Updated package metadata and author info

v0.1.0

  • Initial release with dual model support

Links

License

MIT License - see LICENSE for details.


Made with by Wenliang Zeng

If you find this useful, please consider giving it a star!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

banana_image_mcp-1.0.1.tar.gz (190.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

banana_image_mcp-1.0.1-py3-none-any.whl (81.9 kB view details)

Uploaded Python 3

File details

Details for the file banana_image_mcp-1.0.1.tar.gz.

File metadata

  • Download URL: banana_image_mcp-1.0.1.tar.gz
  • Upload date:
  • Size: 190.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for banana_image_mcp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b6516b306845e47c6c09f25f4c6fb80e91b6b058dc42e62c4f3692930f4139c3
MD5 d7d5d57f7707837a1a577552844d12a2
BLAKE2b-256 0f721d55502471fc30e82f2a648d2432e4075fc4d72279ff076bc9c146bbbb80

See more details on using hashes here.

File details

Details for the file banana_image_mcp-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for banana_image_mcp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5cd06ee37050563d791ddd8c61fb49f260c25d384af3b4d4fc9beb14ef1e47a9
MD5 36ad26e5250d24f61e6f9587a1ed9239
BLAKE2b-256 3e558078d499f8794d6850e8b92c74e04e012a6d70e451b0e439911ddca82aaa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page