Banana Image MCP
Enables AI image generation using Google's Gemini 2.5 Flash and Gemini 3 Pro models, supporting up to 4K resolution output, flexible aspect ratios, Google Search grounding for factual accuracy, and natural language image editing capabilities.
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., "@Banana Image MCPcreate a 4K professional logo for a coffee shop with a minimalist cat design"
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.
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
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
Get a free Gemini API key from Google AI Studio
Have Claude Desktop installed
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 |
|
Windows |
|
Linux |
|
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 DesktopOr 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 |
| string | required | Image description |
| string |
|
|
| string |
|
|
| string | - |
|
| string |
|
|
| bool |
| Enable Google Search grounding (Pro only) |
| int |
| Number of images (1-4) |
| string | - | What to avoid in the image |
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Your Gemini API key |
| No |
| 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.
Fork the Project
Create your Feature Branch (
git checkout -b feature/AmazingFeature)Commit your Changes (
git commit -m 'Add some AmazingFeature')Push to the Branch (
git push origin feature/AmazingFeature)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
FastMCP - The MCP framework that powers this server
Google Gemini - The AI models behind image generation
Anthropic MCP - The protocol specification
Best-README-Template - README inspiration
Available Tools
4 toolsgenerate_imageGenerate or edit images (Multi-Model: Flash & Pro)ARead-only
Generate new images or edit existing images using natural language instructions.
Supports multiple input modes:
Pure generation: Just provide a prompt to create new images
Multi-image conditioning: Provide up to 3 input images using input_image_path_1/2/3 parameters
File ID editing: Edit previously uploaded images using Files API ID
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.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Clear, 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. | |
| n | No | Requested image count (model may return fewer). | |
| negative_prompt | No | Things to avoid (style, objects, text). | |
| system_instruction | No | Optional system tone/style guidance. | |
| input_image_path_1 | No | Path to first input image for composition/conditioning | |
| input_image_path_2 | No | Path to second input image for composition/conditioning | |
| input_image_path_3 | No | Path to third input image for composition/conditioning | |
| file_id | No | Files 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. | |
| mode | No | Operation mode: 'generate' for new image creation, 'edit' for modifying existing images. Auto-detected based on input parameters if not specified. | auto |
| model_tier | No | Model tier: 'flash' (speed, 1024px), 'pro' (quality, up to 4K), or 'auto' (smart selection). Default: 'pro' - uses Pro model for best quality. | pro |
| resolution | No | Output resolution: '4k', '2k', '1k', 'high'. 4K is default for Pro model. Use 'flash' model_tier for faster 1K outputs. | 4k |
| thinking_level | No | Reasoning depth for Pro model: 'low' (faster), 'high' (better quality). Only applies to Pro model. Default: 'high'. | high |
| enable_grounding | No | Enable Google Search grounding for factual accuracy (Pro model only). Useful for real-world subjects. Default: true. | |
| aspect_ratio | No | Optional 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
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.
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.
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.
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.
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.
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 operationsBRead-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
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Maintenance operation to perform: 'cleanup_expired', 'cleanup_local', 'check_quota', 'database_hygiene', 'full_cleanup' | |
| dry_run | No | If true, only report what would be done without making changes | |
| max_age_hours | No | For local cleanup: maximum age in hours (default: 168 = 1 week) | |
| keep_count | No | For local cleanup: minimum number of recent files to keep |
TDQS
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.
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.
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.
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.
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.
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 statsARead-only
Show statistics about the output directory and recently generated images.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Server-accessible file path to upload to Gemini Files API. | |
| display_name | No | Optional display name for the uploaded file. |
TDQS
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.
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.
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.
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.
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.
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
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.
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.
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.
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
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
Generate and edit images and create short videos inside Claude. Prepaid credits, no subscription.
Generate AI images, videos, music, SFX & speech in any AI assistant. Results appear inline in chat.
Generate images with your own ChatGPT subscription (Plus, Pro or Team), without spending API credits
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to generate high-quality images using Google's Gemini and Imagen models with support for multiple aspect ratios, dynamic model selection, and direct file saving capabilities.MIT
- FlicenseNot gradedqualityCmaintenanceEnables image generation and editing using Google's Gemini models with support for model selection and custom aspect ratios. Users can generate high-quality images or modify existing ones through natural language prompts while controlling specific parameters like quality and dimensions.
- FlicenseNot gradedqualityDmaintenanceEnables image generation and prompt enhancement within Claude.ai by leveraging Google Gemini models. It allows users to create visual content in various styles like photorealistic and 3D render directly through natural language.
- FlicenseNot gradedqualityDmaintenanceEnables Claude to generate and edit images using Google Gemini AI.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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