mcp-alphabanana
mcp-alphabanana is an MCP server that generates high-quality image assets using Google Gemini AI models, designed for web/game asset pipelines and MCP-compatible clients (Claude Desktop, VS Code, Cursor).
Image Generation
Create images from text prompts using Gemini model tiers: Flash3.1, Flash2.5, and Pro3
Generate at 0.5K, 1K, 2K, or 4K source resolutions with native aspect ratio support
Supported aspect ratios:
1:1,2:3,3:2,3:4,4:3,9:16,16:9,21:9, and more (Flash3.1 adds1:4,4:1,1:8,8:1)Zero watermarks on all outputs
Output Control
Formats: PNG, JPEG, or WebP
Delivery: Save to file, return as base64, or both
Sizing: Specify exact pixel dimensions or use
noresizeto return Gemini's native dimensionsResize modes:
crop,stretch,letterbox, orcontain
Transparency & Post-Processing
Generate transparent PNG/WebP via automatic background removal (histogram analysis)
Custom color-key transparency with configurable hex color and tolerance
Fringe reduction modes:
auto,crisp, orhdfor clean alpha edges
Advanced Features
Reference image guidance: Provide up to 14 local images (3 for Flash2.5) to influence style/composition
Thinking Mode (
minimalorhigh): Higher prompt adherence (Flash3.1 only)Grounding via Google Search (
text,image, orboth): Search-backed accuracy (Flash3.1 only)Metadata output: Grounding/reasoning metadata and model thought content in JSON
Debug mode: Save intermediate processing artifacts
Enables image generation using Google Gemini models (Flash 3.1, Flash 2.5, Pro 3), supporting features like transparent PNG/WebP assets, local reference image guidance, and search-backed grounding.
mcp-alphabanana
English | 日本語
mcp-alphabanana is a Model Context Protocol (MCP) server for generating image assets with Google Gemini. It is built for MCP-compatible clients and agent workflows that need fast image generation, transparent outputs, reference-image guidance, and flexible delivery formats.
Keywords: MCP server, Model Context Protocol, Gemini AI, image generation, FastMCP
Key capabilities:
Ultra-fast Gemini image generation across Lite, Flash, and Pro tiers
Transparent PNG/WebP asset output for web and game pipelines
Multi-image style guidance with local reference image files
Flexible file, base64, or combined outputs for agent workflows

Quick Start
Run the MCP server with npx:
npx -y @tasopen/mcp-alphabananaOr add it to your MCP configuration:
{
"mcp": {
"servers": {
"mcp-alphabanana": {
"command": "npx",
"args": ["-y", "@tasopen/mcp-alphabanana"],
"env": {
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
}
}
}
}
}Set GEMINI_API_KEY before starting the server.
For Claude Desktop,
Download mcp-alphabanana-latest.mcpb, then add it as Extension from Claude Desktop Settings. For Windows, Recommend add 'FileSystem' extension for better local file handling.
Related MCP server: nano-banana-claude
Claude Registry
The Claude registry / MCPB package metadata is defined in manifest.json and ships with the static 512x512 icon at images/mcp-alphabanana.png.
Native sharp runtime packages are declared as optional dependencies so .mcpb installs can resolve the correct prebuilt binary on each supported platform without relying on postinstall hooks.
Stable MCPB URL:
https://github.com/tasopen/mcp-alphabanana/releases/latest/download/mcp-alphabanana-latest.mcpbVersioned MCPB URL pattern:
https://github.com/tasopen/mcp-alphabanana/releases/download/vVERSION/mcp-alphabanana-VERSION.mcpbSupport: GitHub Issues
MCP Server
This repository provides an MCP server that enables AI agents to generate images using Google Gemini.
It can be used with MCP-compatible clients such as:
Claude Desktop
VS Code MCP
Cursor
Built with FastMCP 3 for a simplified codebase and flexible output options.
Glama MCP Server badge:
Available Tools
generate_image
Generates images using Google Gemini with optional transparency, local reference images, grounding, and reasoning metadata.
For Claude Desktop, prefer outputType=file for medium or large images. base64 and combine responses consume Claude context and can hit the client's size limit. On Windows, use the FileSystem extension to choose a writable absolute outputPath and any local referenceImages paths.
Key parameters:
prompt(string): description of the image to generatemodel:Flash3.1,Lite3.1,Flash2.5,Pro3,flash,prooutputWidthandoutputHeight: requested final image size in pixels in normal modenoresize+aspectRatio+output_resolution: return Gemini native size without resizingoutput_resolution:0.5K,1K,2K,4Koutput_format:png,jpg,webpoutputType:file,base64,combineoutputPath: required whenoutputTypeisfileorcombinetransparent: enable transparent PNG/WebP post-processingreferenceImages: optional array of local reference image filesgrounding_typeandthinking_mode: advanced Gemini 3.1 controls
Model Selection
Input Model ID | Internal Model ID | Description |
|
| Ultra-fast, supports Thinking/Grounding. |
|
| Ultra-fast, cost-effective 1K-only model. No Search Grounding. |
|
| Legacy Flash. High stability. Low cost. |
|
| High-fidelity Pro model. |
|
| Alias for backward compatibility. |
|
| Alias for backward compatibility. |
Parameters
Full parameter reference for the generate_image tool.
Parameter | Type | Default | Description |
| string | required | Description of the image to generate |
| string | required | Output filename (extension auto-added if missing) |
| enum |
|
|
| enum |
| Model: |
| enum | auto |
|
| boolean |
| Skip post-generation resize and return Gemini native dimensions |
| enum | optional | Required when |
| integer | required unless | Final output width in pixels |
| integer | required unless | Final output height in pixels |
| enum |
|
|
| string | required for | Absolute output directory path |
| boolean |
| Transparent background (PNG/WebP only) |
| string or null |
| Color key override for transparency extraction |
| integer |
| Transparency color matching tolerance |
| enum |
|
|
| enum |
|
|
| enum |
|
|
| enum |
|
|
| boolean |
| Return model reasoning fields when metadata is enabled |
| boolean |
| Include grounding and reasoning metadata in JSON output |
| array |
| Up to 14 local reference files (Flash3.1/Pro3/Lite3.1), 3 for Flash2.5 |
| boolean |
| Save intermediate debug artifacts |
Why alphabanana?
Zero Watermarks: API-native clean images.
Thinking/Grounding Support: Higher prompt adherence and search-backed accuracy.
Production Ready: Supports transparent WebP and exact aspect ratios for web and game assets.
Features
Ultra-fast image generation (Gemini 3.1 Flash, 0.5K/1K/2K/4K)
Nano Banana 2 Lite (
Lite3.1): ultra-fast, cost-effective 1K-only model for quick drafting and low-latency iterationAdvanced multi-image reasoning (up to 14 reference images)
Thinking/Grounding support (Flash3.1 only)
Transparent PNG/WebP output (color-key post-processing, despill)
Multiple output formats: file, base64, or both
Flexible resize modes: crop, stretch, letterbox, contain
Multiple model tiers: Flash3.1, Lite3.1, Flash2.5, Pro3, legacy aliases
Example Outputs
These sample outputs were generated with mcp-alphabanana and stored in images/examples.
Pixel art asset | Reference-image game scene | Photorealistic generation |
|
|
|
Configuration
Configure the GEMINI_API_KEY in your MCP configuration (for example, mcp.json).
Examples:
Reference an OS environment variable from
mcp.json:
{
"env": {
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
}
}Provide the key directly in
mcp.json:
{
"env": {
"GEMINI_API_KEY": "your_api_key_here"
}
}VS Code Integration
Add to your VS Code settings (.vscode/settings.json or user settings), configuring the server env in mcp.json or via the VS Code MCP settings.
{
"mcp": {
"servers": {
"mcp-alphabanana": {
"command": "npx",
"args": ["-y", "@tasopen/mcp-alphabanana"],
"env": {
"GEMINI_API_KEY": "${env:GEMINI_API_KEY}"
}
}
}
}
}Optional: Set a custom fallback directory for write failures by adding MCP_FALLBACK_OUTPUT to the env object.
Usage Examples
Basic Generation
{
"prompt": "A pixel art treasure chest, golden trim, wooden texture",
"model": "Flash3.1",
"outputFileName": "chest",
"outputType": "base64",
"outputWidth": 64,
"outputHeight": 64,
"transparent": true
}Native Size Without Resize
{
"prompt": "A clean app icon with a banana mascot, flat graphic design",
"model": "Flash3.1",
"outputFileName": "banana-icon-native",
"outputType": "base64",
"noresize": true,
"aspectRatio": "1:1",
"output_resolution": "0.5K",
"output_format": "png"
}This mode returns the Gemini native pixel size for the requested ratio and resolution. For example, 1:1 + 0.5K returns 512x512 without any resize pass.
Advanced (Vertical poster and thinking)
{
"prompt": "A vertical, photorealistic travel poster advertising Magical Wings Day Tours. A joyful young couple flies high above a breathtaking European countryside at golden hour, holding hands as they soar through a partly cloudy sky. Below them are vineyards, villages, forests, a winding river, and a hilltop medieval castle. The poster uses large, elegant typography with the headline FLY THE COUNTRYSIDE at the top and Magical Wings Day Tours branding near the bottom.",
"model": "Flash3.1",
"output_resolution": "1K",
"outputFileName": "photoreal-travel-poster",
"outputType": "file",
"outputPath": "/path/to/output",
"outputWidth": 848,
"outputHeight": 1264,
"output_format": "jpg",
"thinking_mode": "high",
"include_metadata": true
}Grounding Sample (Search-backed)
{
"prompt": "A modern travel poster featuring today's weather and skyline highlights in Kuala Lumpur",
"model": "Flash3.1",
"outputFileName": "kl_travel_poster",
"outputType": "base64",
"outputWidth": 1024,
"outputHeight": 1024,
"grounding_type": "text",
"thinking_mode": "high",
"include_metadata": true,
"include_thoughts": true
}This sample enables Google Search grounding and returns grounding and reasoning metadata in JSON.
With Reference Images
{
"prompt": "Use the reference image to create a game screen showing an opened treasure chest filled with coins and treasure, 8-bit dungeon crawler style, after-battle reward scene, dungeon corridor background, four-party status UI at the bottom",
"model": "Flash3.1",
"output_resolution": "0.5K",
"outputFileName": "reference-image-dungeon-loot",
"outputType": "file",
"outputPath": "/path/to/output",
"outputWidth": 600,
"outputHeight": 448,
"output_format": "webp",
"transparent": false,
"referenceImages": [
{
"description": "Treasure chest style reference",
"filePath": "/path/to/references/pixel-art-treasure-chest.png"
}
]
}Transparency & Output Formats
PNG: Full alpha, color-key + despill
WebP: Full alpha, better compression (Flash3.1+)
JPEG: No transparency (falls back to solid background)
Development
# Development mode with MCP CLI
npm run dev
# MCP Inspector (Web UI)
npm run inspect
# Build for production
npm run buildLicense
MIT
Available Tools
1 toolgenerate_imageADestructive
Generate image assets using Gemini AI with optional transparency and reference images.
[Claude Desktop Guidance]
Prefer outputType='file' for medium or large images. base64 and combine responses can exceed Claude Desktop's context limit.
On Claude Desktop for Windows, use the FileSystem extension to choose reference-image paths and a writable absolute outputPath before calling this tool.
Use base64 only for small previews or when the client explicitly needs inline image data.
[Model Guidance]
Flash3.1 (recommended): High quality, very fast, supports grounding and advanced features.
Lite3.1 (Nano Banana 2 Lite): Ultra-fast, cost-effective, 1K-only, no search grounding. Ideal for quick drafting and low-latency iteration.
Pro3: Higher fidelity, but more costly and slower.
Flash2.5: Legacy, maintained for compatibility. Does not support 0.5K, 2K, or 4K resolutions.
[Aspect Ratios] Gemini supports the following aspect ratios (model-dependent):
Common to all models: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Flash3.1 only: 1:4, 4:1, 1:8, 8:1
Normal mode: provide outputWidth/outputHeight and the server will choose the closest Gemini aspect ratio and source resolution, then resize to the requested pixel size. No-resize mode: set noresize=true and provide aspectRatio plus output_resolution. The server will return Gemini's native pixel dimensions for that combination without post-generation resizing.
If you intentionally want to control resizing/cropping in normal mode, use the 'resizeMode' parameter: 'crop' (default, center crop), 'letterbox' (fit with padding), 'contain' (trim transparent margins then fit), or 'stretch' (distort to fit).
[IMPORTANT] Always preserve the user's prompt as-is, including language and nuance. Do not translate or summarize.
| Name | Required | Description | Default |
|---|---|---|---|
| debug | No | Debug mode: output intermediate processing images and prompt | |
| model | No | Model tier to use for generation (see tool description for details; "flash" and "pro" are aliases for Flash2.5 and Pro3; "Lite3.1" is the low-latency Nano Banana 2 Lite model, 1K-only, no grounding) | Flash3.1 |
| prompt | Yes | User-provided image prompt. Preserve the original wording and detail; do not summarize or translate. Only append transparency-related hints if needed. | |
| noresize | No | Skip post-generation resizing and return Gemini native dimensions directly. When true, provide aspectRatio and output_resolution instead of outputWidth/outputHeight. | |
| fringeMode | No | Fringe reduction mode: auto (size-based), crisp (binary alpha), hd (force-clear 1px boundary for large images). | auto |
| outputPath | No | Output directory path (MUST be an absolute path when outputType is file or combine). In Claude Desktop on Windows, use the FileSystem extension to choose or prepare a writable absolute path such as C:\temp. | |
| outputType | No | Output format: file=file only, base64=base64 only, combine=both. In Claude Desktop, prefer file for medium or large images to avoid context-size limits; use base64 only for small previews. | combine |
| resizeMode | No | Resize mode: crop=center crop, stretch=distort, letterbox=fit with padding, contain=trim transparent margins then fit | crop |
| aspectRatio | No | Gemini aspect ratio to use directly when noresize=true. Ignored in normal resize mode. | |
| outputWidth | No | Output image width in pixels. Required unless noresize=true. In normal mode, the image will be generated using the closest supported Gemini aspect ratio and resolution, then resized to this width. | |
| transparent | No | Request transparent background (PNG or WebP only). Background color is selected by histogram analysis. | |
| outputHeight | No | Output image height in pixels. Required unless noresize=true. In normal mode, the image will be generated using the closest supported Gemini aspect ratio and resolution, then resized to this height. | |
| output_format | No | Output format | png |
| thinking_mode | No | Thinking mode (3.1 only) | minimal |
| colorTolerance | No | Tolerance for color matching (0-255). Higher values are more permissive for transparent color selection and keying. | |
| grounding_type | No | Grounding tool usage (3.1 only) | none |
| outputFileName | Yes | Output filename (extension auto-added if missing) | |
| referenceImages | No | Reference images for style guidance (Flash2.5: max 3, others: max 14) | |
| include_metadata | No | Include grounding and reasoning metadata in JSON output (optional, may increase payload size). | |
| include_thoughts | No | Optional (default: false). Request thought fields from Gemini (3.1 only). Thought content is returned in MCP response only when include_metadata=true. | |
| transparentColor | No | Color to make transparent. Hex (e.g. #FF00FF). null defaults to #FF00FF when transparent=true. | |
| output_resolution | No | Gemini generation source resolution (optional in normal mode, required when noresize=true). In normal mode, the final image is resized to the requested pixel size after generation. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses key behaviors beyond annotations: it explains that the tool generates files on disk (outputPath), handles resizing and cropping, supports transparency, and has model-dependent features. Annotations already indicate destructiveHint=true and openWorldHint=true, so the description adds context about what gets created and modified. However, it does not explicitly warn about overwriting existing files, which would have earned a 5.
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 long but well-structured with sections (Claude Desktop Guidance, Model Guidance, Aspect Ratios, IMPORTANT) and uses bullet points for readability. It front-loads the main purpose and then provides detailed guidance. While every sentence contributes value, some redundancy with schema descriptions could be trimmed slightly.
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 the tool's complexity (22 parameters, multiple modes, platform specifics), the description is quite comprehensive. It covers purpose, usage guidelines, model comparisons, resize behavior, output types, and important notes. However, it lacks explicit details about error responses or rate limits, and there is no output schema, but the description compensates well for the tool's generative nature.
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%, so parameters are already documented. The description adds value by grouping parameters logically (e.g., model selection, aspect ratios, resize modes) and providing context for platform-specific usage (e.g., referenceImages filePath on Windows). It explains the interaction between parameters like outputWidth/outputHeight and noresize, which goes beyond individual parameter descriptions.
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 opens with 'Generate image assets using Gemini AI with optional transparency and reference images,' clearly stating the action, resource, and technology. It differentiates between different usage contexts (Claude Desktop, Windows, etc.) and provides model recommendations, ensuring the agent understands what the tool does and when to use which option.
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 includes explicit guidance on when to use different output types ('Prefer outputType='file' for medium or large images'), when to use noresize mode vs normal mode, and when to choose each model (Flash3.1 recommended, Lite3.1 for quick drafting, etc.). It also provides platform-specific usage instructions for Claude Desktop and Windows, giving clear context for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no potential for confusion between tools. The single tool's purpose is clearly defined as generating images.
There is only one tool, so naming consistency is not applicable. The tool name 'generate_image' follows a clear verb_noun convention.
The server has a single tool, which is slightly thin but acceptable given the tool's complexity and the server's focused purpose of image generation. The tool includes many parameters and guidance, making it substantial.
The tool provides comprehensive image generation capabilities with support for multiple AI models, aspect ratios, output formats, and advanced options like no-resize and resize modes. It covers the full scope of image generation for the server's domain.
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
MCP server for Qwen Image 3 AI image generation
MCP server for NanoBanana AI image generation and editing
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server for Google Veo AI video generation
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP server for generating, editing, and processing images via multiple providers including Kilo, OpenRouter, OpenAI, and Gemini, with local tools for background removal, resizing, and cropping.232MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides image generation using Google's Nano Banana Gemini models, with additional tools for background removal, upscaling, and format conversion via deterministic post-processing.1MIT
- FlicenseAqualityDmaintenanceWraps Google Gemini's image generation API as an MCP server, enabling text-to-image, image editing, and grounded search workflows from any MCP client.2
- AlicenseNot gradedqualityDmaintenanceMCP server for Google's Nano Banana image generation models (Gemini). Generate and edit images via natural language.191MIT
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/tasopen/mcp-alphabanana'
If you have feedback or need assistance with the MCP directory API, please join our Discord server

