home / mcp / nano-banana mcp server
A Nano Banana MCP server, which you can integrate to cursor/claude code and any mcp client
Configuration
View docs{
"mcpServers": {
"conechoai-nano-banana-mcp": {
"command": "npx",
"args": [
"nano-banana-mcp"
],
"env": {
"GEMINI_API_KEY": "your-gemini_api_key_here"
}
}
}
}You can generate and edit AI-generated images using a dedicated MCP server that talks to Google's Gemini API. This server supports creating images from text, editing them with prompts, and iterating on results, with optional style guidance from reference images. It works with popular MCP clients and handles secure API key usage, automatic file management, and crossβplatform file paths for Windows, macOS, and Linux.
Use a compatible MCP client to connect to the Nano-Banana MCP Server. You can generate new images from text prompts, edit existing images with prompts, and continue refining the latest result. When you want to apply style guidance or reference images, provide one or more reference files to guide the generation or editing process. The server stores generated and edited images in platform-appropriate directories for easy access.
Typical workflows include starting with a base prompt to generate an image, using the continue editing flow to refine composition and lighting, and applying style transfers or additional prompts to reach the desired look. You can also ask the server to continue editing the last result to incrementally improve details or drama.
Prerequisites: install Node.js 18.0.0 or higher, and obtain a Gemini API key from Google AI Studio.
Clone the project and install dependencies, then run the development server or build for production.
# Clone the repository
git clone https://github.com/claude-code/nano-banana-mcp.git
cd nano-banana-mcp
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests
npm testConfigure the server in your MCP client by pointing it to the local or remote MCP endpoint and providing the Gemini API key securely.
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}Security is improved by placing sensitive keys in MCP client configuration environments rather than in shared files. The Gemini API key can be supplied via MCP config env variables or via system environment variables, in that priority order.
Configuration priority (highest to lowest): MCP configuration environment variables, system environment variables, local configuration files created by the Gemini token configuration tool.
Images are saved to platform-appropriate locations to keep files organized.
Windows: %USERPROFILE%\Documents\nano-banana-images\
macOS/Linux: ./generated_imgs/ in the current directory
System-wide directory when run from system paths: ~/nano-banana-images/
Generated image files use the naming convention: generated-[timestamp]-[id].png and edited images use edited-[timestamp]-[id].png.
Basic Image Generation: generate_image, then continue_editing twice for refinement.
Style Transfer: generate_image with a base concept, edit_image with reference images for style, then continue_editing for fine-tuning.
Iterative Design: generate_image, get_last_image_info, continue_editing, repeat until satisfied.
The MCP server exposes a set of actions you can invoke from your client to create and modify images.
generate_image: create a new image from a text prompt.
edit_image: modify a specific image with a prompt and optional reference images.
continue_editing: continue refining the last image with a new prompt and optional references.
get_last_image_info: retrieve information about the most recent image.
configure_gemini_token: set or update your Gemini API key.
get_configuration_status: verify if the Gemini API key is configured.
Create a new image from a text prompt. This is the base entry point for producing visuals from your description.
Edit a specific image file using a natural language prompt and optional reference images to guide the transformation.
Continue refining the last generated or edited image with additional prompts, enabling iterative design.
Fetch information about the most recently generated image, including metadata and status.
Configure or update the Gemini API key used for authentication with the image API.
Check whether the Gemini API key has been configured and is ready for use.