Purpose
mcp-alphabanana is a local server based on the Model Context Protocol (MCP), used to generate image assets with Google Gemini (Nano Banana 2 / Pro). It is aimed at MCP-compatible clients and agent workflows, meeting needs such as rapid image generation, transparent output, reference image guidance, and flexible delivery formats. Its keywords include MCP server, Model Context Protocol, Gemini AI, image generation, FastMCP.
Main capabilities
- Uses Nano Banana 2.1 image generation by default, and provides multiple tiers such as Lite, Flash, and Pro.
- Can output transparent PNG/WebP assets, suitable for web and game pipelines.
- Supports using local reference image files for multi-image style guidance.
- Flexible output methods: file, base64, or a combination of both, adapting to agent workflows.
- Supports advanced controls: grounding (including Google Search grounding) and thinking mode, returning grounding and reasoning metadata.
- Supports multi-image reasoning (up to 14 reference images).
- Provides flexible scaling modes: crop, stretch, letterbox, contain.
- Built with FastMCP 3, with a cleaner codebase and more flexible output options.
Model tiers
- NanoBanana2.1 (default, gemini-nano-banana-2.1, supports 1K/2K/4K output)
- Nano Banana 2 Lite (Lite3.1): ultra-fast, cost-friendly 1K-only model, suitable for quick drafts and low-latency iteration
- Flash3.1 (deprecated)
- Lite3.1
- Flash2.5
- Pro3
- and the aliases flash, pro
Usage
Run the MCP server with npx, or add it to the MCP configuration. GEMINI_API_KEY must be set before starting the server.
Claude Desktop users can download mcp-alphabanana-latest.mcpb, then in Claude Desktop settings under Extensions. On Windows platforms, it is recommended to add the 'FileSystem' extension for better handling of local files.
Stable MCPB download address:https://github.com/tasopen/mcp-alphabanana/releases/latest/download/mcp-alphabanana-latest.mcpb
Versioned MCPB address format:https://github.com/tasopen/mcp-alphabanana/releases/download/vVERSION/mcp-alphabanana-VERSION.mcpb
Claude Registry / MCPB package metadata is defined in manifest.json, and is accompanied by a static 512x512 icon images/mcp-alphabanana.png. The native sharp runtime package is declared as an optional dependency, allowing .mcpb installation on supported platforms to resolve the correct prebuilt binary without relying on a postinstall hook.
generate_image tool parameters
This tool uses Google Gemini to generate images, with optional transparency, local reference images, grounding, and reasoning metadata.
Key parameters:
- prompt (string): a description of the image to generate
- model: NanoBanana2.1 (default), Flash3.1 (deprecated), Lite3.1, Flash2.5, Pro3, and the aliases flash, pro
- outputWidth and outputHeight: the requested final image pixel dimensions in normal mode
- noresize + aspectRatio + output_resolution: return Gemini native dimensions without scaling
- output_resolution: 1K, 2K, 4K
- output_format: png, jpg, webp
- outputType: file, base64, combine
- outputPath: required when outputType is file or combine
- transparent: enable transparent PNG/WebP post-processing
- referenceImages: an optional array of local reference image files
- grounding_type and thinking_mode: advanced Gemini controls (thinking_mode: minimal / medium / high, default medium)
For Claude Desktop, it is recommended to use outputType=file for medium and large images; base64 and combine responses consume Claude context and may hit client size limits. On Windows, use the FileSystem extension to choose a writable absolute outputPath and the local referenceImages path.
Transparency and output formats
- PNG: full alpha, color key + despill
- WebP: full alpha, better compression
- JPEG: transparency not supported (falls back to a solid color background)
Nano Banana 2.1 does not provide native transparent output. When transparent=true is specified, mcp-alphabanana performs local post-processing to generate an alpha channel.
Configuration
Configure GEMINI_API_KEY in the MCP configuration (for example, mcp.json). You can reference an operating system environment variable, or provide the key directly in mcp.json.
VS Code integration: add the configuration to VS Code settings (.vscode/settings.json or user settings), and configure the server env in mcp.json or through the VS Code MCP settings. Optional: add MCP_FALLBACK_OUTPUT to the env object to set a custom fallback directory for when writing fails.
Use cases and limitations
Suitable for MCP clients and agent workflows that need rapid generation of image assets, transparent assets, reference-image guidance, and programmable delivery formats. Before use, a Google Gemini GEMINI_API_KEY is required; transparent output depends on local post-processing rather than native model capabilities; the JPEG format does not support transparency; some model tiers (such as Flash3.1) have been marked as deprecated. 0.5K resolution has been removed in v1.6.0.