MCP Banana Image
Generates product images optimized for Amazon, including platform compliance, style presets, and aspect ratios tailored for Amazon listings.
Generates social media images optimized for Instagram, with platform-specific aspect ratios, safe zones, and layouts.
Generates product images optimized for Shopee, with platform compliance, style presets, and aspect ratios tailored for Shopee listings.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Banana Imagegenerate a sunset over mountains"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Overview
MCP Banana Image is a Model Context Protocol (MCP) server that brings AI-powered image generation capabilities to your favorite AI coding assistants. Built with Google's Nano Banana 2 (gemini-3.1-flash-image) for image generation and gemini 3 flash for text enhancement, it offers 16 specialized tools for image generation, editing, analysis, and processing - all through a simple natural language interface.
Highlights
16 Specialized Tools - From simple generation to advanced style transfer
Custom API Endpoint Support - Use with Cliproxyapi or other Gemini API proxies
Intelligent Prompt Enhancement - Automatically optimizes your prompts for better results
Dual Transport - STDIO (default) and HTTP (Streamable HTTP Transport)
Docker Ready - Deploy as HTTP server with Docker
Features
Category | Features |
Generation | AI image generation, logos, icons, products, social media, UGC, infographics, character sets |
Editing | Image editing, background removal, image blending, style transfer |
Analysis | AI-powered image analysis with descriptions, alt-text, tags, and OCR |
Processing | Format conversion, resizing, compression |
Quality | 2K/4K resolution, 10 aspect ratios, 4 output formats, smart compression |
Consistency | Character consistency, style transfer, reference image support |
Integration | Google Search grounding, world knowledge, platform-specific optimization |
Requirements
Node.js 20+
Gemini API Key from Google AI Studio or Cliproxyapi
Installation
Claude Code
claude mcp add mcp-banana-image \
--env GEMINI_API_KEY=your_api_key \
--env GEMINI_BASE_URL=https://generativelanguage.googleapis.com \
--env IMAGE_OUTPUT_DIR=/path/to/output \
--env SKIP_PROMPT_ENHANCEMENT=false \
-- npx -y mcp-banana-imageAdd --scope user for global installation.
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"mcp-banana-image": {
"command": "npx",
"args": ["-y", "mcp-banana-image"],
"env": {
"GEMINI_API_KEY": "your_api_key",
"GEMINI_BASE_URL": "https://generativelanguage.googleapis.com",
"IMAGE_OUTPUT_DIR": "/path/to/output",
"SKIP_PROMPT_ENHANCEMENT": "false"
}
}
}
}Codex
Add to ~/.codex/config.toml:
[mcp_servers.mcp-banana-image]
command = "npx"
args = ["-y", "mcp-banana-image"]
[mcp_servers.mcp-banana-image.env]
GEMINI_API_KEY = "your_api_key"
GEMINI_BASE_URL = "https://generativelanguage.googleapis.com"
IMAGE_OUTPUT_DIR = "/path/to/output"
SKIP_PROMPT_ENHANCEMENT = "false"OpenCode
Add to your opencode.json in your project root or ~/.config/opencode/config.json for global config:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-banana-image": {
"type": "local",
"command": ["npx", "-y", "mcp-banana-image"],
"enabled": true,
"environment": {
"GEMINI_API_KEY": "your_api_key",
"GEMINI_BASE_URL": "https://generativelanguage.googleapis.com",
"IMAGE_OUTPUT_DIR": "/path/to/output",
"SKIP_PROMPT_ENHANCEMENT": "false"
}
}
}
}With Cliproxy custom endpoint:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-banana-image": {
"type": "local",
"command": ["npx", "-y", "mcp-banana-image"],
"enabled": true,
"environment": {
"GEMINI_API_KEY": "your_cliproxy_api_key",
"GEMINI_BASE_URL": "https://yourdomain.com",
"IMAGE_OUTPUT_DIR": "/path/to/output"
}
}
}
}To use the tool, add use mcp-banana-image to your prompts or add this to your AGENTS.md:
When you need to generate, edit, or analyze images, use `mcp-banana-image` tools.Custom API Endpoint
MCP Banana Image supports custom Gemini API endpoints, allowing you to use alternative API providers like Cliproxy or your own proxy servers.
Using with Cliproxy
Cliproxy is a Gemini API proxy service that provides enhanced reliability, rate limiting, and additional features.
Configuration Example (Claude Code with Cliproxy)
claude mcp add mcp-banana-image \
--env GEMINI_API_KEY=your_cliproxy_api_key \
--env GEMINI_BASE_URL=https://yourdomain.com \
--env IMAGE_OUTPUT_DIR=/path/to/output \
-- npx -y mcp-banana-imageConfiguration Example (manual json)
{
"mcpServers": {
"mcp-banana-image": {
"command": "npx",
"args": ["-y", "mcp-banana-image"],
"env": {
"GEMINI_API_KEY": "your_cliproxy_api_key",
"GEMINI_BASE_URL": "https://yourdomain.com",
"IMAGE_OUTPUT_DIR": "/path/to/output"
}
}
}
}Security Notes
Production: Only HTTPS endpoints are allowed
Development: HTTP/localhost endpoints are permitted for testing
The endpoint URL is validated before use to prevent SSRF attacks
Tools Reference
MCP Banana Image provides 16 specialized tools organized by category:
Image Generation Tools
Tool | Description | Key Features |
| Generate images from text prompts | Auto prompt enhancement, style presets, aspect ratios |
| Advanced generation with full control | All parameters exposed, reference images, character consistency |
| Generate professional logos | Business name/tagline, 8 styles, transparent backgrounds, color branding |
| Generate icons, avatars, stickers | 6 styles (flat, outlined, 3D), multiple sizes (16-512px) |
| E-commerce product photography | 5 style presets, platform compliance (Amazon, Shopee, Tokopedia), 6 categories |
| Platform-optimized social content | 9 platforms, auto aspect ratios, text-safe zones |
| Authentic user-generated content | 7 scenarios, 10 settings, smartphone aesthetic |
| AI-powered infographics | 4 styles, 4 layouts, brand colors, icon hints |
| Consistent character series | Poses, expressions, 5 art styles, sprite sheet output |
Image Editing Tools
Tool | Description | Key Features |
| Edit images with natural language | Add/remove elements, change backgrounds, enhance |
| Remove image backgrounds | Transparent PNG output, AI-powered segmentation |
| Blend multiple images | 4 modes (seamless, collage, double-exposure, overlay), 2-4 images |
| Apply artistic styles | Single/multiple references, style strength control, element preservation |
Image Processing Tools
Tool | Description | Key Features |
| Format conversion | PNG, JPEG, WebP, AVIF, compression presets |
| Resize images | Exact dimensions, 5 fit modes, aspect preservation |
Analysis Tools
Tool | Description | Key Features |
| AI-powered image analysis | Descriptions, alt-text, tags, OCR, moderation |
Usage Examples
Basic Image Generation
"Generate a mountain landscape at sunset"Logo Generation
generate_logo businessName='TechStart' tagline='Innovation Made Simple' style='modern'Product Photography
generate_product productDescription='handmade leather wallet' style='premium' platform='amazon'Social Media Content
generate_social_media content='summer sale announcement' platform='instagram-post'User-Generated Content
generate_ugc description='person enjoying morning coffee' scenario='lifestyle' setting='home'Character Set Generation
generate_character_set characterDescription='friendly robot mascot' poses=['front', 'waving'] style='cartoon'Style Transfer
style_transfer referenceStyleImage='./van-gogh.jpg' contentDescription='mountain landscape' styleStrength=0.8Image Analysis
analyze_image imagePath='/path/to/photo.jpg' analysisType='description'Background Removal
remove_background imagePath='/path/to/product.jpg'Image Blending
blend_images imagePaths=['./bg.jpg', './subject.png'] instruction='Place subject on background' blendMode='seamless'Infographic Generation
generate_infographic content='5 steps to improve productivity: 1. Set goals...' style='corporate' layout='vertical'Image Resizing
resize_image inputPath='./photo.jpg' width=800 height=600 fit='cover'Environment Variables
Core Configuration
Variable | Required | Default | Description |
| Yes | - | Google AI or Cliproxy API key |
| No | Google default | Custom API endpoint (e.g., Cliproxy) |
| No |
| Output directory for generated images |
| No |
| Disable automatic prompt optimization |
HTTP Transport Configuration
Variable | Required | Default | Description |
| No |
| Transport mode: |
| Yes (http) | - | API key for HTTP authentication |
| No |
| HTTP server port |
| No |
| HTTP server bind address |
| No |
| CORS allowed origins |
| No |
| HTTP request timeout in ms |
Output Formats & Compression
Supported Formats
Format | Description | Transparency | Best For |
| Lossless | Yes | Graphics, logos, icons |
| Lossy | No | Photos, large images |
| Modern | Yes | Web optimization |
| Best compression | Yes | Modern browsers |
Compression Presets
Preset | Description | Use Case |
| No quality loss | Archival, source files |
| Minimal loss | Professional work |
| Good quality/size ratio | General use |
| Smallest file size | Web optimization |
Aspect Ratios
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9Docker Deployment
Build and Run
docker build -t mcp-banana-image .
docker-compose updocker-compose.yml
services:
mcp-banana-image:
build: .
ports:
- "3000:3000"
volumes:
- ./output:/app/output
environment:
- GEMINI_API_KEY=${GEMINI_API_KEY}
- GEMINI_BASE_URL=${GEMINI_BASE_URL}
- MCP_API_KEY=${MCP_API_KEY}
- MCP_TRANSPORT=httpHealth Check
curl http://localhost:3000/healthResponse:
{
"status": "ok",
"timestamp": "2024-01-01T00:00:00.000Z",
"sessions": 0
}Architecture
flowchart TB
subgraph Client
A[AI Assistant]
end
subgraph MCP Server
B[Transport Layer]
C[MCP Handler]
D[Tool Registry]
E[16 Specialized Tools]
F[Image Processor]
G[File Manager]
end
subgraph "AI Providers"
H[Gemini API]
I[Cliproxy API]
end
A -->|STDIO/HTTP| B
B --> C
C --> D
D --> E
E -->|API Calls| H
E -->|API Calls| I
E --> F
F -->|Save| G
G --> J[(Output)]Troubleshooting
API key not found
Verify
GEMINI_API_KEYis set correctlyFor Cliproxy: ensure you're using the correct Cliproxy API key
Check key permissions at Google AI Studio
Custom endpoint connection failed
Verify
GEMINI_BASE_URLis correctly formatted (include full URL with protocol)Ensure the endpoint is accessible from your network
For production: only HTTPS endpoints are allowed
Image not saved
Ensure
IMAGE_OUTPUT_DIRis an absolute pathCheck directory write permissions
Verify disk space availability
Generation timeout
High resolution images (4K) take longer
Character sets with many poses/expressions take longer
Consider increasing
MCP_HTTP_TIMEOUTfor HTTP modeCheck network connectivity to API endpoint
Prompt blocked by safety filters
Rephrase your prompt to avoid potentially sensitive content
The AI may reject prompts that could generate inappropriate imagery
Character consistency issues
Provide detailed character descriptions
Use reference images when available
Enable
maintainCharacterConsistencyoption
Development
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Run with coverage
npm run test:coverage
# Lint and format
npm run check:allLicense
MIT
Contributing
We welcome contributions! Please read our Contributing Guide for guidelines on how to submit changes.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/Trigi-Digital/mcp-banana-image'
If you have feedback or need assistance with the MCP directory API, please join our Discord server