MCP Nano Banana
Generates images from text prompts using the Google Gemini API and returns them as base64-encoded data
Click on "Deploy 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 Nano Bananagenerate an image of a futuristic city with flying cars at sunset"
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.
MCP Nano Banana
This project is an MCP (Model Context Protocol) server that generates images using the Google Gemini API.
Description
This server implements the Model Context Protocol to expose a single tool, generate_image, to a compatible AI model. The tool accepts a text prompt, uses the Google Gemini API to generate an image, saves the image to the public/ directory for auditing, and returns the raw image data as a base64-encoded string.
Related MCP server: Nano Banana
To use the server with Claude Desktop or other applications
You need a Google Gemini API key and ImgBB API key to use this server.
Access https://api.imgbb.com/ to generate a IMGBB API Key. This is used to store and host the image online.
{
"mcpServers": {
"mcp-nano-banana": {
"command": "uvx",
"args": [
"mcp-nano-banana"
],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY_HERE",
"IMGBB_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}Dev Setup
1. Dependencies
This project uses Python and its dependencies are defined in pyproject.toml. You can install them using pip:
pip install .
# Or
uv syncThis will install mcp, google-generativeai, and other required packages.
2. API Key
You need a Google Gemini API key and ImgBB API key to use this server.
Access https://api.imgbb.com/ to generate a IMGBB API Key. This is used to store and host the image online.
Create a file named
.envin the root of the project.Add your API key to the
.envfile in the following format:
GEMINI_API_KEY="YOUR_API_KEY_HERE"
IMGBB_API_KEY="YOUR_API_KEY_HERE"Running the Server
This server is designed to be run as a subprocess by an MCP client or using the mcp command-line tool. The server listens for requests on stdio.
uvx --from git+https://github.com/GuilhermeAumo/mcp-nano-banana mcp-nano-bananaPublishing new pipy version
To publish a new version of this package to PyPI:
Update the version
Edit theversionfield inpyproject.tomlto the new version number.Build the package
Run:uv buildThis will create
.tar.gzand.whlfiles in thedist/directory.Upload to PyPI
uv publishTag the release (optional but recommended)
Commit the changes to github first, then:git tag v<new-version> git push --tags
Note:
You need a PyPI account and must be listed as a maintainer of the project.
For more details, see the Python Packaging User Guide.
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate images with your own ChatGPT subscription (Plus, Pro or Team), without spending API credits
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Generate and edit images and videos with imageat.
Generate image thumbnails, resize, convert and compress photos from your AI chat. Local files.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceGenerates images from text prompts using Google's Gemini AI models with customizable aspect ratios and resolutions up to 4K, automatically saving images locally.24 npm2MIT
- AlicenseBqualityDmaintenanceEnables image generation using Google Gemini models like Gemini 2.0 Flash and Imagen 3.0 with support for custom aspect ratios and negative prompts. It also allows users to list and manage generated images stored in local directories.27 npmMIT
- FlicenseNot gradedqualityDmaintenanceGenerates images using Google's Gemini model, with options to save to file or return as base64 data URL.-
- AlicenseNot gradedqualityDmaintenanceEnables image generation and transformation using Google Gemini AI, with automatic English translation for multilingual prompts and local saving.MIT