nano-banana-pro-mcp
v1.0.1
Published
MCP server for 4K image generation using Gemini 3 Pro Image with advanced features
Maintainers
Readme
Nano Banana Pro MCP Server
4K Image Generation with Gemini 3 Pro Image
MCP server enabling Claude to generate and edit high-quality 4K images using Google's Gemini 3 Pro Image model (gemini-3-pro-image-preview). Features advanced text rendering, "thinking" process for complex prompts, and iterative editing capabilities.
Features
- 4K Output Resolution: Generate images up to 4096x4096 pixels
- Advanced Text Rendering: Superior text integration in images
- Thinking Process: Model reasons through complex prompts for better results
- Iterative Editing: Continue editing previous images without re-uploading
- State Management: Automatic tracking of last generated image
Tools Provided
1. nb_pro_generate_image
Generate a NEW 4K image from text prompt.
Parameters:
prompt(string, required): Text description of the image to create
Example:
{
"prompt": "A futuristic cityscape at sunset with flying cars and neon signs"
}2. nb_pro_edit_image
Edit a SPECIFIC existing image file.
Parameters:
imagePath(string, required): Full file path to the image to editprompt(string, required): Description of modifications to make
Example:
{
"imagePath": "/path/to/image.png",
"prompt": "change the sky to purple and add mountains in background"
}3. nb_pro_continue_editing
Continue editing the LAST generated/edited image.
Parameters:
prompt(string, required): Description of modifications to make
Example:
{
"prompt": "change the hat color to red and add flowers"
}4. nb_pro_get_last_image
Get information about the last generated/edited image.
Parameters: None
Returns:
imagePath: Path to last imagelastPrompt: Prompt used to generate/edittimestamp: When image was createdfileSize: File size in KB
Installation
Prerequisites
- Node.js 18+
- Gemini API key from Google AI Studio
Step 1: Install Dependencies
cd /Users/adriencastelain/Documents/ClaudeWorkspace/mcp-servers/nano-banana-pro
npm installStep 2: Build TypeScript
npm run buildThis compiles TypeScript to JavaScript in dist/ directory.
Step 3: Add to MCP Configuration
Add this entry to your mcp.json (or claude_desktop_config.json):
{
"mcpServers": {
"nano-banana-pro": {
"command": "node",
"args": [
"/Users/adriencastelain/Documents/ClaudeWorkspace/mcp-servers/nano-banana-pro/dist/index.js"
],
"env": {
"GEMINI_API_KEY": "${GEMINI_API_KEY}"
}
}
}
}Note: Uses same GEMINI_API_KEY as regular nano-banana MCP server.
Step 4: Reload VSCode Window
- Cmd+Shift+P
- Select "Developer: Reload Window"
- Wait 10-15 seconds for MCP to initialize
Step 5: Verify Installation
In Claude Code chat, run:
Can you list the available nano banana pro tools?You should see 4 tools:
nb_pro_generate_imagenb_pro_edit_imagenb_pro_continue_editingnb_pro_get_last_image
Usage Examples
Generate New Image
Generate a 4K image of a minimalist tech startup logo with abstract geometric shapes in blue and whiteEdit Specific Image
Edit /path/to/image.png - change the background to dark gradient and add lens flareContinue Editing Last Image
Now add text "INNOVATION" in bold sans-serif font centered at topCheck Last Image
What was the last image I generated with nano banana pro?Output Directory
All generated images are saved to:
/Users/adriencastelain/Documents/ClaudeWorkspace/generated_imgs/Filename Format:
- Generated:
generated-YYYYMMDD-HHMMSS-abc123.png - Edited:
edited-YYYYMMDD-HHMMSS-abc123.png
State File:
.nano-banana-pro-state.json stores last image info for continue_editing tool.
Model Details
Model: gemini-3-pro-image-preview
Capabilities:
- 4K resolution output (up to 4096x4096)
- Advanced text rendering in images
- "Thinking" process for complex prompts
- Higher quality than Gemini 2.5 Flash
- Better handling of detailed scenes
API Endpoint: Google Generative AI SDK Authentication: GEMINI_API_KEY environment variable
Comparison: Nano Banana vs Nano Banana Pro
| Feature | Nano Banana | Nano Banana Pro |
|---------|-------------|-----------------|
| Model | gemini-2.0-flash-exp | gemini-3-pro-image-preview |
| Max Resolution | 2048x2048 | 4096x4096 |
| Text Rendering | Good | Advanced |
| Complex Prompts | Standard | Thinking Process |
| Speed | Faster | Slower (higher quality) |
| Use Case | Quick iterations | Final high-quality output |
Troubleshooting
"GEMINI_API_KEY environment variable not set"
Solution: Ensure your mcp.json has GEMINI_API_KEY in the env section and the key is set in your shell environment.
"No image data in response"
Solution: Model may not support the exact prompt. Try simplifying or rephrasing the prompt.
"Image file not found"
Solution: Use absolute file paths with nb_pro_edit_image. Or use nb_pro_continue_editing to edit the last generated image.
Build errors
Solution:
rm -rf node_modules package-lock.json
npm install
npm run buildDevelopment
Watch Mode (auto-rebuild on save):
npm run watchManual Test:
export GEMINI_API_KEY="your-key-here"
npm testTechnical Architecture
Transport: stdio (standard input/output) Language: TypeScript (compiled to Node.js) Dependencies:
@modelcontextprotocol/sdk- MCP protocol implementation@google/generative-ai- Gemini API client
State Management:
- Last image tracked in
.nano-banana-pro-state.json - Base64 encoding for in-memory image data
- Persistent across MCP sessions
Security Notes
- API key stored in environment variable (not in code)
- Images saved to local directory only
- No external hosting or sharing
- State file contains base64 image data (can be large)
Performance
Generation Time:
- Simple prompts: 10-20 seconds
- Complex prompts: 30-60 seconds (thinking process)
File Sizes:
- 4K images: 500KB - 2MB per image
- State file: up to 10MB (contains last image base64)
License
MIT License - Atlas (MCP Builder AI) - Boald
Version History
- v1.0.0 (2025-12-02): Initial release with 4 tools (generate, edit, continue_editing, get_last_image)
Support
For issues or feature requests, contact Atlas (MCP Builder AI) or Phoenix (DevOps).
Status: ✅ SANDBOX - Ready for testing (not in production yet)
