home / mcp / nano banana pro mcp server
Provides image generation/editing/composition via MCP with Google Gemini 2.0 Flash grounding and multiple output options.
Configuration
View docs{
"mcpServers": {
"konigt6905-nano-banana-pro-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GEMINI_API_KEY",
"-v",
"$(pwd)/output:/output",
"-v",
"$(pwd)/input:/input:ro",
"nano-banana-pro-mcp"
],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY"
}
}
}
}This MCP Server lets you generate, edit, and compose images using natural language directly from your coding environment. It brings Google Gemini 2.0 Flash image generation capabilities into Claude Code and other MCP-enabled assistants, enabling high‑quality creations without leaving your workflow.
You access this server from an MCP client and call its image tools to generate or edit images from prompts. The core capabilities you can rely on are: generate new images from text prompts, edit existing images with text instructions, continue editing the last image, compose multiple reference images into a new composition, and optionally ground image generation with real‑time information. You can specify output size and aspect ratios to fit your project, and you can enable real‑time search grounding when you need up‑to‑date visuals.
Prerequisites you must have before starting: Docker Desktop installed and running. You also need a Gemini API key from Google AI Studio to enable the image generation backend.
Step 1: Build the Docker image for the MCP server.
cd nano-banana-pro-mcp
docker build -t nano-banana-pro-mcp .Step 2: Create the directories that will hold input and output files.
mkdir -p output inputStep 3: Add the MCP server configuration to Claude Code using one of the two options below.
Option A: Using claude mcp add (recommended). This registers the MCP server with Claude Code and uses a docker run invocation to start the server.
claude mcp add nano-banana-pro \
--transport stdio \
-- docker run -i --rm \
-e GEMINI_API_KEY=$GEMINI_API_KEY \
-v $(pwd)/output:/output \
-v $(pwd)/input:/input:ro \
nano-banana-pro-mcpOption B: Manual configuration in Claude Code MCP config. This is a direct JSON configuration you place in your MCP settings.
{
"mcpServers": {
"nano-banana-pro": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GEMINI_API_KEY",
"-v", "$(pwd)/output:/output",
"-v", "$(pwd)/input:/input:ro",
"nano-banana-pro-mcp"
],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}The server exposes a set of image tools you can call from your MCP client. You can provide an output aspect ratio and resolution when generating or editing images, and you can enable Google Search grounding for real‑time information. Generated assets are stored in the /output directory by default, which is mounted from your host system according to how you start the container.
If the Gemini API key is not set properly, confirm that GEMINI_API_KEY is provided in the environment and that your shell exports it before starting the container. If images do not appear, verify that the /output directory is writable and correctly mounted. On Linux, you may need to adjust permissions for the output directory to allow the current user to write files.
For local development, you can install dependencies, build, and run the server in a Node/npm environment if you prefer to run outside Docker. Ensure your GEMINI_API_KEY is available and set OUTPUT_DIR to the directory you want images saved to.
MIT Licensed. Acknowledgments go to Google Gemini for the image generation API and to the Model Context Protocol ecosystem for enabling MCP integrations.
Create a new image from a text prompt with optional aspect ratio and resolution settings.
Modify an existing image using a text prompt, with optional reference images, aspect ratio, and resolution.
Iteratively refine the last generated image by supplying additional prompts and optional references.
Combine multiple input images into a single composition guided by a prompt; supports up to 14 images.
Retrieve information about the most recently generated or edited image.
Check whether the API key and configuration are ready to use.