- Home
- MCP servers
- Gemini Nanobanana
Gemini Nanobanana
- typescript
12
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"junhan2-gemini-nanobanana-mcp": {
"command": "npx",
"args": [
"gemini-nanobanana-mcp@latest"
],
"env": {
"AUTO_SAVE": "true",
"LOG_LEVEL": "debug",
"GEMINI_API_KEY": "YOUR_API_KEY",
"DEFAULT_SAVE_DIR": "~/Downloads/gemini-images"
}
}
}
}You can generate AI images from text inside Claude conversations using the Gemini Nanobanana MCP. This MCP server connects Google's Gemini 2.5 Flash Image generation to your Claude chats, letting you describe an image and receive a generated result that saves automatically or to a location you specify.
How to use
Interact with Claude as you normally would. Describe the image you want, for example: “Generate a cozy coffee shop interior” or “Create a sunset landscape.” The MCP handles the text-to-image generation and returns an image you can save or view inline. You can also tailor the output by prompting for style, mood, and composition, then choose where to save the result.
Your images are saved by default to a dedicated directory unless you override the path. The typical default save location is your downloads folder under a Gemini images subdirectory. You can adjust saving behavior with environment variables described later.
How to install
Prerequisites: ensure you have Node.js installed (LTS version recommended). You will also need npm and npx available from your Node installation.
# 1) Ensure Node.js is installed (LTS)
node -v
npm -v
# 2) Create a configuration for the MCP client you use (examples shown below)
Configure and run the MCP server
Choose one of the standard MCP setup methods shown below. Each method configures the Gemini Nanobanana MCP with your API key so you can start generating images in Claude.
Placeholders are shown where you must insert your actual API key obtained from Google AI Studio.
Common clip: when you run the MCP, you should provide your API key via the GEMINI_API_KEY environment variable.
Start the MCP with a standard stdio configuration using npx to run the package. The following example shows a typical setup you can copy and adapt.
{
"mcpServers": {
"gemini-nanobanana-mcp": {
"command": "npx",
"args": ["gemini-nanobanana-mcp@latest"],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY"
}
}
}
}
Start Creating!
Once your MCP is running, you can start asking Claude to generate images. Try prompts like those in the examples and observe the images being created and saved automatically.
Examples and prompts
Text-to-image generation: describe what you want and let the MCP render it. Example prompts include:
- "A majestic dragon flying over a medieval castle"
- "Modern minimalist living room with plants"
- "Vintage bicycle on a cobblestone street"
Image editing and composition capabilities let you adjust existing images or combine multiple images into a single output. You can specify stylistic changes, backgrounds, or blending effects directly in your prompts.
Saving and file locations
By default, generated images are saved to a dedicated folder for Gemini images. You can customize the save behavior and location using environment variables described in the configuration section.
Basic save example in practice:
- If you prompt Claude to create an image, it appears in the chat while also being saved to the configured directory. You can also specify a custom save path in your prompts or configuration.
Configuration options
Environment variables control API access and save behavior. The key ones are GEMINI_API_KEY, AUTO_SAVE, DEFAULT_SAVE_DIR, and LOG_LEVEL. Use GEMINI_API_KEY to authenticate, AUTO_SAVE to enable/disable automatic saving, DEFAULT_SAVE_DIR to set the default location, and LOG_LEVEL to adjust the verbosity of logs.
Examples of configuration are shown in the snippets below. Adjust to your workflow and preferred paths.
{
"mcpServers": {
"gemini-nanobanana-mcp": {
"command": "npx",
"args": ["gemini-nanobanana-mcp@latest"],
"env": {
"GEMINI_API_KEY": "your-api-key",
"AUTO_SAVE": "true",
"DEFAULT_SAVE_DIR": "~/Pictures/AI-Images",
"LOG_LEVEL": "debug"
}
}
}
}
Troubleshooting
If you encounter issues, verify that your API key is correctly set and that Claude is restarted after changes. Ensure you have internet access and that the MCP server process is running. If images do not save automatically, check the AUTO_SAVE setting and the save directory permissions.
Common problems and fixes include invalid GEMINI_API_KEY, missing or blocked network access, and ensuring you are using the MCP-enabled Claude interface for Code or Desktop as appropriate.
Tips for better images
Prompt crafting matters. Be specific and include style cues, lighting, mood, and details to guide the generator toward your vision.
Advanced features
If you want to run the MCP as an HTTP service for integrations, you can enable an HTTP transport, but this guide focuses on the standard stdio setup used within Claude.
Need Help?
If you have questions or want to report issues, reach out through the established support channels. You can also keep experimenting with prompts and saving options to refine your workflow.
Available tools
Text-to-Image Generation
Create any image you can imagine from a text description.
Image Editing
Edit existing images with natural language instructions to apply changes, filters, or backgrounds.
Image Composition
Combine multiple images into a single composition or collage.
Style Transfer
Apply the style of one image to another image.