home / mcp / mcp nano banana mcp server

MCP Nano Banana MCP Server

Use Google's most advanced image model Nano Banana with your AI of choice!

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "guilhermeaumo-mcp-nano-banana": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/GuilhermeAumo/mcp-nano-banana",
        "mcp-nano-banana"
      ],
      "env": {
        "IMGBB_API_KEY": "YOUR_API_KEY_HERE",
        "GEMINI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You run an MCP server that exposes a single tool, generate_image, which uses the Google Gemini API to create images from text prompts. It saves generated images to public/ for auditing and returns the image data as a base64 string so clients can display or store the result.

How to use

To use this server with an MCP client, start the server as a subprocess under your MCP workflow. The server provides a generate_image tool that accepts a text prompt and returns a base64-encoded image. Ensure you provide both a Google Gemini API key and an ImgBB API key so images can be generated and hosted for auditing.

How to install

Prerequisites: you need Python installed on your system. You will also use the MCP framework tooling to run and manage the server.

Step-by-step commands to set up and run the server.

# 1) Install the MCP package and dependencies
pip install .
# or if you prefer the MCP workflow tool
uv sync

# 2) Create environment configuration with your API keys
# Create a file named .env in the project root and add:
GEMINI_API_KEY="YOUR_API_KEY_HERE"
IMGBB_API_KEY="YOUR_API_KEY_HERE"

# 3) Start the MCP server as a stdio process using uvx (example command shown below relies on the documented runtime)
uvx --from git+https://github.com/GuilhermeAumo/mcp-nano-banana mcp-nano-banana

Additional sections

Configuration and startup rely on two API keys: GEMINI_API_KEY for Google Gemini access and IMGBB_API_KEY for hosting images. Place these values in a .env file at the root of the project, or export them in your environment before starting the server.

Security notes: keep your API keys private and rotate them if you believe they have been compromised. Only trusted clients should be allowed to invoke generate_image, since the tool can incur API usage costs.

If you encounter issues, verify that the environment variables are loaded, the Gemini and ImgBB keys are valid, and the process has permissions to write to the public/ directory. Check that the client sends prompts in a supported format and that the host machine can access the Gemini API.

Available tools

generate_image

Generates an image from a text prompt using the Google Gemini API, saves the image to public/ for auditing, and returns the raw image as a base64-encoded string.