nano-banana-mcp-azure-blob
v1.1.6
Published
MCP server for Google's Gemini 2.5 Flash Image generation API with Azure Blob Storage support
Maintainers
Readme
Nano-Banana MCP Server with Azure Blob Storage 🍌☁️
🔗 This project is forked from nano-banana-mcp with enhanced Azure Blob Storage support for cloud-based image storage.
A Model Context Protocol (MCP) server that provides AI image generation and editing capabilities using Google's Gemini 2.5 Flash Image API. Generate stunning images, edit existing ones, and iterate on your creations with simple text prompts. Images can be stored locally or uploaded to Azure Blob Storage for cloud access.
✨ Features
- 🎨 Generate Images: Create new images from text descriptions
- ✏️ Edit Images: Modify existing images with text prompts
- 🔄 Iterative Editing: Continue editing the last generated/edited image
- 🖼️ Multiple Reference Images: Use reference images for style transfer and guidance
- ☁️ Azure Blob Storage: Upload images to cloud storage with public URLs
- 📁 Local Storage Fallback: Automatic fallback to local storage if Azure is unavailable
- 🌍 Cross-Platform: Smart file paths for Windows, macOS, and Linux
- 🔧 Easy Setup: Simple configuration with API key
- 🔗 Shareable URLs: Cloud-stored images get public URLs for easy sharing
🔑 Setup
Get your Gemini API key:
- Visit Google AI Studio
- Create a new API key
- Copy it for configuration
Optional: Set up Azure Blob Storage (for cloud storage):
- See the detailed Azure Setup Guide
- Create an Azure Storage Account
- Get your connection string
- Configure environment variables
Configure the MCP server: See configuration examples for your specific client below (Claude Code, Cursor, or other MCP clients).
💻 Usage with Claude Code
Configuration:
Add this to your Claude Code MCP settings:
Option A: With Azure Blob Storage (Recommended for cloud storage)
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here",
"AZURE_STORAGE_CONNECTION_STRING": "your-azure-storage-connection-string",
"AZURE_STORAGE_CONTAINER_NAME": "nano-banana-images"
}
}
}
}Option B: Local storage only
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}Usage Examples:
Generate an image of a sunset over mountainsEdit this image to add some birds in the skyContinue editing to make it more dramatic🎯 Usage with Cursor
Configuration:
Add to your Cursor MCP configuration:
Option A: With Azure Blob Storage (Recommended for cloud storage)
{
"nano-banana": {
"command": "npx",
"args": ["nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here",
"AZURE_STORAGE_CONNECTION_STRING": "your-azure-storage-connection-string",
"AZURE_STORAGE_CONTAINER_NAME": "nano-banana-images"
}
}
}Option B: Local storage only
{
"nano-banana": {
"command": "npx",
"args": ["nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}Usage Examples:
- Ask Cursor to generate images for your app
- Create mockups and prototypes
- Generate assets for your projects
🔧 For Other MCP Clients
If you're using a different MCP client, you can configure nano-banana-mcp using any of these methods:
Configuration Methods
Method A: Environment Variable in MCP Config with Azure Blob Storage (Recommended)
{
"nano-banana": {
"command": "npx",
"args": ["nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here",
"AZURE_STORAGE_CONNECTION_STRING": "your-azure-storage-connection-string",
"AZURE_STORAGE_CONTAINER_NAME": "nano-banana-images"
}
}
}Method B: System Environment Variable
export GEMINI_API_KEY="your-gemini-api-key-here"
export AZURE_STORAGE_CONNECTION_STRING="your-azure-connection-string"
export AZURE_STORAGE_CONTAINER_NAME="nano-banana-images"
npx nano-banana-mcpMethod C: Using the Configure Tool
npx nano-banana-mcp
# The server will prompt you to configure when first used
# This creates a local .nano-banana-config.json file🛠️ Available Commands
generate_image
Create a new image from a text prompt. Images are automatically uploaded to Azure Blob Storage if configured, or saved locally as fallback.
generate_image({
prompt: "A futuristic city at night with neon lights"
})edit_image
Edit a specific image file (supports both local files and Azure Blob Storage URLs).
edit_image({
imagePath: "/path/to/image.png", // or Azure Blob URL
prompt: "Add a rainbow in the sky",
referenceImages?: ["/path/to/reference.jpg"] // optional
})continue_editing
Continue editing the last generated/edited image (works with both local and cloud-stored images).
continue_editing({
prompt: "Make it more colorful",
referenceImages?: ["/path/to/style.jpg"] // optional
})get_last_image_info
Get information about the last generated image (shows storage location and access details).
get_last_image_info()configure_gemini_token
Configure your Gemini API key.
configure_gemini_token({
apiKey: "your-gemini-api-key"
})get_configuration_status
Check if the API key is configured.
get_configuration_status()⚙️ Configuration Priority
The MCP server loads your API key in the following priority order:
🥇 MCP Configuration Environment Variables (Highest Priority)
- Set in your
claude_desktop_config.jsonor MCP client config - Most secure as it's contained within the MCP configuration
- Example:
"env": { "GEMINI_API_KEY": "your-key" }
- Set in your
🥈 System Environment Variables
- Set in your shell/system environment
- Example:
export GEMINI_API_KEY="your-key"
🥉 Local Configuration File (Lowest Priority)
- Created when using the
configure_gemini_tokentool - Stored as
.nano-banana-config.jsonin current directory - Automatically ignored by Git and NPM
- Created when using the
💡 Recommendation: Use Method 1 (MCP config env variables) for the best security and convenience.
📁 File Storage
Azure Blob Storage (Recommended)
For cloud storage, configure Azure Blob Storage by adding these environment variables:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here",
"AZURE_STORAGE_CONNECTION_STRING": "your-azure-storage-connection-string",
"AZURE_STORAGE_CONTAINER_NAME": "nano-banana-images"
}
}
}
}Azure Setup:
- Create an Azure Storage Account in the Azure Portal
- Go to Access keys and copy the connection string
- Set
AZURE_STORAGE_CONNECTION_STRINGenvironment variable - Optionally set
AZURE_STORAGE_CONTAINER_NAME(defaults to "nano-banana-images")
Benefits:
- ☁️ Images stored in the cloud with public URLs
- 🔗 Easy sharing and access from anywhere
- 📈 Scalable storage solution
- 🔒 Secure with Azure's enterprise-grade security
Local Storage (Fallback)
If Azure Blob Storage is not configured, images are saved locally to platform-appropriate locations:
- Windows:
%USERPROFILE%\\Documents\\nano-banana-images\\ - macOS/Linux:
./generated_imgs/(in current directory) - System directories:
~/nano-banana-images/(when run from system paths)
File naming convention:
- Generated images:
generated-[timestamp]-[id].png - Edited images:
edited-[timestamp]-[id].png
🎨 Example Workflows
Basic Image Generation
generate_image- Create your base imagecontinue_editing- Refine and improvecontinue_editing- Add final touches
Style Transfer
generate_image- Create base contentedit_image- Use reference images for stylecontinue_editing- Fine-tune the result
Iterative Design
generate_image- Start with a conceptget_last_image_info- Check current statecontinue_editing- Make adjustments- Repeat until satisfied
🔧 Development
This project is forked from nano-banana-mcp with additional Azure Blob Storage functionality. It uses these technologies:
- TypeScript - Type-safe development
- Node.js - Runtime environment
- Zod - Schema validation
- Google GenAI - Image generation API
- MCP SDK - Model Context Protocol
- Azure Storage SDK - Cloud storage integration
Local Development
# Clone the repository
git clone https://github.com/your-username/nano-banana-mcp-azure-blob.git
cd nano-banana-mcp-azure-blob
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your API keys
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests
npm test
# Test Azure integration
node test-azure-integration.js📋 Requirements
- Node.js 18.0.0 or higher
- Gemini API key from Google AI Studio
- Optional: Azure Storage Account (for cloud storage)
- Compatible with Claude Code, Cursor, and other MCP clients
🤝 Contributing
This project is forked from nano-banana-mcp with Azure Blob Storage enhancements. Contributions are welcome! Please feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
- Enhance Azure storage functionality
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
- Original nano-banana-mcp - For the base project this is forked from
- Claude Code - For generating the original project
- Google AI - For the powerful Gemini 2.5 Flash Image API
- Microsoft Azure - For the reliable Blob Storage service
- Anthropic - For the Model Context Protocol
- Open Source Community - For the amazing tools and libraries
📞 Support
- 🐛 Issues: Create issues for bugs or feature requests
- 📖 Documentation: This README, Azure Setup Guide, and inline code comments
- 💬 Discussions: For questions and community support
- 🔧 Azure Setup: See AZURE_SETUP.md for detailed Azure configuration
🆕 What's New in This Fork
- ☁️ Azure Blob Storage Integration: Upload images to cloud storage with public URLs
- 🔄 Automatic Fallback: Seamlessly falls back to local storage if Azure is unavailable
- 🌐 Public URLs: Generated images get shareable public URLs when using Azure
- 📋 Enhanced Commands: All existing commands work with both local and cloud storage
- 🛠️ Easy Configuration: Simple environment variable setup for Azure
🍌 Enhanced with Azure Blob Storage for better image management and sharing!
