{"_id":"@akashvekariya/nano-banana-mcp","name":"@akashvekariya/nano-banana-mcp","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@akashvekariya/nano-banana-mcp","version":"1.1.0","description":"MCP server for Google's Gemini image generation API (Nano Banana) with configurable model support","main":"dist/index.js","type":"module","bin":{"nano-banana-mcp":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsx src/index.ts","test":"jest","lint":"eslint src/**/*.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build && npm run typecheck"},"keywords":["mcp","nano-banana","gemini","gemini-3-pro","image-generation","ai","google-ai","claude-code","cursor","image-editing"],"author":{"name":"akashvekariya"},"license":"MIT","homepage":"https://github.com/akashvekariya/Nano-Banana-MCP#readme","repository":{"type":"git","url":"git+https://github.com/akashvekariya/Nano-Banana-MCP.git"},"bugs":{"url":"https://github.com/akashvekariya/Nano-Banana-MCP/issues"},"engines":{"node":">=18.0.0"},"dependencies":{"@google/genai":"^1.16.0","@modelcontextprotocol/sdk":"^1.0.0","dotenv":"^16.4.5","zod":"^3.22.4"},"devDependencies":{"@types/node":"^20.11.0","@typescript-eslint/eslint-plugin":"^6.19.0","@typescript-eslint/parser":"^6.19.0","eslint":"^8.56.0","tsx":"^4.7.0","typescript":"^5.3.3"},"_id":"@akashvekariya/nano-banana-mcp@1.1.0","gitHead":"5ce5d6aff6cb25ef1f084b8ee11766b2029a5d8b","types":"./dist/index.d.ts","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-ex3kOnA58/N6JrODYhorl19HwVcn41eHzj+MGm3I9h3/a9uB9jfKY6YsQRD/tshecA5S3bsMCPSzy/TLwb08Dw==","shasum":"7ea8d8caa3a1ee656e57a325355a988a57ca38a4","tarball":"https://registry.npmjs.org/@akashvekariya/nano-banana-mcp/-/nano-banana-mcp-1.1.0.tgz","fileCount":7,"unpackedSize":69642,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD7sFJt7YbnaLHDMMxhuThWgIOpJhRKTjkBHllwFZMx9gIhAIrJf1MbLeQgO3qeVfyOXQppqSPzxl4/ulGzBA2GOK04"}]},"_npmUser":{"name":"akashvekariya","email":"hello@akashvekariya.com"},"directories":{},"maintainers":[{"name":"akashvekariya","email":"hello@akashvekariya.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nano-banana-mcp_1.1.0_1769242709503_0.6338001501005255"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-24T08:18:29.438Z","1.1.0":"2026-01-24T08:18:29.648Z","modified":"2026-01-24T08:18:29.807Z"},"maintainers":[{"name":"akashvekariya","email":"hello@akashvekariya.com"}],"description":"MCP server for Google's Gemini image generation API (Nano Banana) with configurable model support","homepage":"https://github.com/akashvekariya/Nano-Banana-MCP#readme","keywords":["mcp","nano-banana","gemini","gemini-3-pro","image-generation","ai","google-ai","claude-code","cursor","image-editing"],"repository":{"type":"git","url":"git+https://github.com/akashvekariya/Nano-Banana-MCP.git"},"author":{"name":"akashvekariya"},"bugs":{"url":"https://github.com/akashvekariya/Nano-Banana-MCP/issues"},"license":"MIT","readme":"# Nano-Banana MCP Server 🍌\n\n> **🤖 This project was forked from [ConechoAI/Nano-Banana-MCP](https://github.com/ConechoAI/Nano-Banana-MCP)** and enhanced with configurable model support.\n\nA Model Context Protocol (MCP) server that provides AI image generation and editing capabilities using Google's Gemini Image API. Generate stunning images, edit existing ones, and iterate on your creations with simple text prompts.\n\n**Now supports both Gemini 3 Pro Image (Nano Banana Pro) and Gemini 2.5 Flash Image!**\n\n## ✨ Features\n\n- 🎨 **Generate Images**: Create new images from text descriptions\n- ✏️ **Edit Images**: Modify existing images with text prompts\n- 🔄 **Iterative Editing**: Continue editing the last generated/edited image\n- 🖼️ **Multiple Reference Images**: Use reference images for style transfer and guidance\n- 🌍 **Cross-Platform**: Smart file paths for Windows, macOS, and Linux\n- 🔧 **Easy Setup**: Simple configuration with API key\n- 📁 **Auto File Management**: Automatic image saving with organized naming\n- 🔀 **Configurable Models**: Switch between Gemini 3 Pro Image and Gemini 2.5 Flash Image\n\n## 🤖 Available Models\n\n| Model | Slug | Description |\n|-------|------|-------------|\n| **Gemini 3 Pro Image** | `gemini-3-pro-image-preview` | Highest quality, advanced reasoning (Default) |\n| **Gemini 2.5 Flash Image** | `gemini-2.5-flash-image` | Fast, high-volume generation |\n\n## 🔑 Setup\n\n1. **Get your Gemini API key**:\n   - Visit [Google AI Studio](https://aistudio.google.com/app/apikey)\n   - Create a new API key\n   - Copy it for configuration\n\n2. **Configure the MCP server**:\n   See configuration examples for your specific client below (Claude Code, Cursor, or other MCP clients).\n\n## 💻 Usage with Claude Code\n\n### Configuration:\n\nAdd this to your Claude Code MCP settings:\n\n**Option A: With environment variable (Recommended - Most Secure)**\n```json\n{\n  \"mcpServers\": {\n    \"nano-banana\": {\n      \"command\": \"npx\",\n      \"args\": [\"@akashvekariya/nano-banana-mcp\"],\n      \"env\": {\n        \"GEMINI_API_KEY\": \"your-gemini-api-key-here\",\n        \"GEMINI_MODEL\": \"gemini-3-pro-image-preview\"\n      }\n    }\n  }\n}\n```\n\n**Option B: Install from GitHub directly**\n```json\n{\n  \"mcpServers\": {\n    \"nano-banana\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"github:akashvekariya/Nano-Banana-MCP\"],\n      \"env\": {\n        \"GEMINI_API_KEY\": \"your-gemini-api-key-here\",\n        \"GEMINI_MODEL\": \"gemini-3-pro-image-preview\"\n      }\n    }\n  }\n}\n```\n\n**Option C: Without environment variable**\n```json\n{\n  \"mcpServers\": {\n    \"nano-banana\": {\n      \"command\": \"npx\",\n      \"args\": [\"@akashvekariya/nano-banana-mcp\"]\n    }\n  }\n}\n```\n\n### Usage Examples:\n```\nGenerate an image of a sunset over mountains\n```\n\n```\nEdit this image to add some birds in the sky\n```\n\n```\nContinue editing to make it more dramatic\n```\n\n## 🎯 Usage with Cursor\n\n### Configuration:\n\nAdd to your Cursor MCP configuration:\n\n**Option A: With environment variable (Recommended)**\n```json\n{\n  \"nano-banana\": {\n    \"command\": \"npx\",\n    \"args\": [\"@akashvekariya/nano-banana-mcp\"],\n    \"env\": {\n      \"GEMINI_API_KEY\": \"your-gemini-api-key-here\",\n      \"GEMINI_MODEL\": \"gemini-3-pro-image-preview\"\n    }\n  }\n}\n```\n\n**Option B: Without environment variable**\n```json\n{\n  \"nano-banana\": {\n    \"command\": \"npx\",\n    \"args\": [\"@akashvekariya/nano-banana-mcp\"]\n  }\n}\n```\n\n### Usage Examples:\n- Ask Cursor to generate images for your app\n- Create mockups and prototypes\n- Generate assets for your projects\n\n## 🔧 For Other MCP Clients\n\nIf you're using a different MCP client, you can configure nano-banana-mcp using any of these methods:\n\n### Configuration Methods\n\n**Method A: Environment Variable in MCP Config (Recommended)**\n```json\n{\n  \"nano-banana\": {\n    \"command\": \"npx\",\n    \"args\": [\"@akashvekariya/nano-banana-mcp\"],\n    \"env\": {\n      \"GEMINI_API_KEY\": \"your-gemini-api-key-here\",\n      \"GEMINI_MODEL\": \"gemini-3-pro-image-preview\"\n    }\n  }\n}\n```\n\n**Method B: System Environment Variable**\n```bash\nexport GEMINI_API_KEY=\"your-gemini-api-key-here\"\nexport GEMINI_MODEL=\"gemini-3-pro-image-preview\"\nnpx @akashvekariya/nano-banana-mcp\n```\n\n**Method C: Using the Configure Tool**\n```bash\nnpx @akashvekariya/nano-banana-mcp\n# The server will prompt you to configure when first used\n# This creates a local .nano-banana-config.json file\n```\n\n## 🌐 Environment Variables\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| `GEMINI_API_KEY` | Yes | - | Your Gemini API key from Google AI Studio |\n| `GEMINI_MODEL` | No | `gemini-3-pro-image-preview` | Model to use for image generation |\n\n## 🛠️ Available Commands\n\n### `generate_image`\nCreate a new image from a text prompt.\n```typescript\ngenerate_image({\n  prompt: \"A futuristic city at night with neon lights\",\n  aspectRatio: \"16:9\",    // optional\n  resolution: \"2K\",       // optional\n  useGoogleSearch: true   // optional\n})\n```\n\n### `edit_image`\nEdit a specific image file.\n```typescript\nedit_image({\n  imagePath: \"/path/to/image.png\",\n  prompt: \"Add a rainbow in the sky\",\n  referenceImages: [\"/path/to/reference.jpg\"], // optional\n  aspectRatio: \"16:9\",    // optional\n  resolution: \"2K\",       // optional\n  useGoogleSearch: false  // optional\n})\n```\n\n### `continue_editing`\nContinue editing the last generated/edited image.\n```typescript\ncontinue_editing({\n  prompt: \"Make it more colorful\",\n  referenceImages: [\"/path/to/style.jpg\"], // optional\n  aspectRatio: \"9:16\",    // optional\n  resolution: \"4K\",       // optional\n  useGoogleSearch: false  // optional\n})\n```\n\n### 📐 Aspect Ratio Options\n\n| Value | Use Case |\n|-------|----------|\n| `1:1` | Square (default), Instagram post |\n| `16:9` | Widescreen, landscape, desktop, YouTube thumbnail |\n| `9:16` | Portrait, mobile, vertical, TikTok, Instagram Reels/Stories |\n| `4:3` | Standard landscape |\n| `3:4` | Standard portrait |\n| `4:5` | Instagram portrait |\n| `5:4` | Instagram landscape |\n| `3:2` | Classic photo landscape |\n| `2:3` | Classic photo portrait |\n| `21:9` | Ultrawide, cinematic |\n\n### 🖼️ Resolution Options\n\n| Value | Size | Use Case |\n|-------|------|----------|\n| `1K` | 1024px | Fast generation (default) |\n| `2K` | 2048px | High quality |\n| `4K` | 4096px | Ultra quality, print (Gemini 3 Pro only) |\n\n### `get_available_models`\nList all available Gemini image generation models and show which one is currently active.\n```typescript\nget_available_models()\n```\n\n### `set_model`\nSwitch to a different model during the session. Use this when you want faster generation or higher quality.\n```typescript\nset_model({\n  model: \"gemini-2.5-flash-image\" // or \"gemini-3-pro-image-preview\"\n})\n```\n\n### `get_last_image_info`\nGet information about the last generated image.\n```typescript\nget_last_image_info()\n```\n\n### `configure_gemini_token`\nConfigure your Gemini API key.\n```typescript\nconfigure_gemini_token({\n  apiKey: \"your-gemini-api-key\"\n})\n```\n\n### `get_configuration_status`\nCheck if the API key is configured and which model is active.\n```typescript\nget_configuration_status()\n```\n\n## ⚙️ Configuration Priority\n\nThe MCP server loads your configuration in the following priority order:\n\n1. **🥇 MCP Configuration Environment Variables** (Highest Priority)\n   - Set in your `claude_desktop_config.json` or MCP client config\n   - Most secure as it's contained within the MCP configuration\n   - Example: `\"env\": { \"GEMINI_API_KEY\": \"your-key\", \"GEMINI_MODEL\": \"gemini-3-pro-image-preview\" }`\n\n2. **🥈 System Environment Variables**\n   - Set in your shell/system environment\n   - Example: `export GEMINI_API_KEY=\"your-key\"`\n\n3. **🥉 Local Configuration File** (Lowest Priority)\n   - Created when using the `configure_gemini_token` tool\n   - Stored as `.nano-banana-config.json` in current directory\n   - Automatically ignored by Git and NPM\n\n**💡 Recommendation**: Use Method 1 (MCP config env variables) for the best security and convenience.\n\n## 📁 File Storage\n\nImages are automatically saved to platform-appropriate locations:\n\n- **Windows**: `%USERPROFILE%\\\\Documents\\\\nano-banana-images\\\\`\n- **macOS/Linux**: `./generated_imgs/` (in current directory)\n- **System directories**: `~/nano-banana-images/` (when run from system paths)\n\nFile naming convention:\n- Generated images: `generated-[timestamp]-[id].png`\n- Edited images: `edited-[timestamp]-[id].png`\n\n## 🎨 Example Workflows\n\n### Basic Image Generation\n1. `generate_image` - Create your base image\n2. `continue_editing` - Refine and improve\n3. `continue_editing` - Add final touches\n\n### Style Transfer\n1. `generate_image` - Create base content\n2. `edit_image` - Use reference images for style\n3. `continue_editing` - Fine-tune the result\n\n### Iterative Design\n1. `generate_image` - Start with a concept\n2. `get_last_image_info` - Check current state\n3. `continue_editing` - Make adjustments\n4. Repeat until satisfied\n\n## 🔧 Development\n\nThis project uses the following technologies:\n\n- **TypeScript** - Type-safe development\n- **Node.js** - Runtime environment\n- **Zod** - Schema validation\n- **Google GenAI** - Image generation API\n- **MCP SDK** - Model Context Protocol\n\n### Local Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/akashvekariya/Nano-Banana-MCP.git\ncd Nano-Banana-MCP\n\n# Install dependencies\nnpm install\n\n# Run in development mode\nnpm run dev\n\n# Build for production\nnpm run build\n\n# Run tests\nnpm test\n```\n\n## 📋 Requirements\n\n- Node.js 18.0.0 or higher\n- Gemini API key from Google AI Studio\n- Compatible with Claude Code, Cursor, and other MCP clients\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to:\n\n- Report bugs\n- Suggest new features\n- Submit pull requests\n- Improve documentation\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- **[ConechoAI/Nano-Banana-MCP](https://github.com/ConechoAI/Nano-Banana-MCP)** - Original project\n- **[Claude Code](https://claude.ai/code)** - For generating the original project\n- **Google AI** - For the powerful Gemini Image API\n- **Anthropic** - For the Model Context Protocol\n- **Open Source Community** - For the amazing tools and libraries\n\n## 📞 Support\n\n- 🐛 **Issues**: [GitHub Issues](https://github.com/akashvekariya/Nano-Banana-MCP/issues)\n- 📖 **Documentation**: This README and inline code comments\n- 💬 **Discussions**: [GitHub Discussions](https://github.com/akashvekariya/Nano-Banana-MCP/discussions)\n\n---\n\n*✨ Fork of the original [Nano-Banana-MCP](https://github.com/ConechoAI/Nano-Banana-MCP) with configurable model support!*\n","readmeFilename":"README.md","_rev":"1-cba470538f328f64cc2c664f8d02ec6a"}