Generates images from text prompts using the Google Gemini API and returns them as base64-encoded data
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.
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.
Dev Setup
1. Dependencies
This project uses Python and its dependencies are defined in pyproject.toml
. You can install them using pip
:
This 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
.env
in the root of the project. - Add your API key to the
.env
file in the following format:
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
.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables image generation using the Google Gemini API through a simple text prompt. Generated images are saved locally and hosted online via ImgBB for easy access and sharing.
Related MCP Servers
- -securityAlicense-qualityA server that provides AI-powered image generation, modification, and processing capabilities through the Model Context Protocol, leveraging Google Gemini models and other image services.Last updated -13MIT License
- -securityFlicense-qualityA server that connects to the xAI/Grok image generation API, allowing users to generate images from text prompts with support for multiple image generation and different response formats.Last updated -8
- AsecurityAlicenseAqualityAllows AI assistants to generate and transform high-quality images from text prompts using Google's Gemini model via the MCP protocol.Last updated -319MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides image generation capabilities using Google's Gemini 2 API, allowing users to generate multiple images with customizable parameters like prompts, aspect ratios, and person generation settings.Last updated -1373MIT License