Skip to content
Back to search

Nano-Banana-MCP

A Nano Banana MCP server, which you can integrate to cursor/claude code and any mcp client

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/conechoai--nano-banana-mcp/badge.svg)](/listings/conechoai--nano-banana-mcp)

HTML

<a href="/listings/conechoai--nano-banana-mcp"><img src="/api/listings/conechoai--nano-banana-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 306 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Nano-Banana MCP Server 🍌
  2. > **🤖 This project was entirely generated by [Claude Code](https://claude.ai/code)** - an AI coding assistant that can create complete, production-ready applications from scratch.
  3. 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.
  4. <a href="https://glama.ai/mcp/servers/@ConechoAI/Nano-Banana-MCP">
  5. <img width="380" height="200" src="https://glama.ai/mcp/servers/@ConechoAI/Nano-Banana-MCP/badge" alt="Nano-Banana-MCP MCP server" />
  6. </a>
  7. ## ✨ Features
  8. - 🎨 **Generate Images**: Create new images from text descriptions
  9. - ✏️ **Edit Images**: Modify existing images with text prompts
  10. - 🔄 **Iterative Editing**: Continue editing the last generated/edited image
  11. - 🖼️ **Multiple Reference Images**: Use reference images for style transfer and guidance
  12. - 🌍 **Cross-Platform**: Smart file paths for Windows, macOS, and Linux
  13. - 🔧 **Easy Setup**: Simple configuration with API key
  14. - 📁 **Auto File Management**: Automatic image saving with organized naming
  15. ## 🔑 Setup
  16. 1. **Get your Gemini API key**:
  17. - Visit [Google AI Studio](https://aistudio.google.com/app/apikey)
  18. - Create a new API key
  19. - Copy it for configuration
  20. 2. **Configure the MCP server**:
  21. See configuration examples for your specific client below (Claude Code, Cursor, or other MCP clients).
  22. ## 💻 Usage with Claude Code
  23. ### Configuration:
  24. Add this to your Claude Code MCP settings:
  25. **Option A: With environment variable (Recommended - Most Secure)**
  26. ```json
  27. {
  28. "mcpServers": {
  29. "nano-banana": {
  30. "command": "npx",
  31. "args": ["nano-banana-mcp"],
  32. "env": {
  33. "GEMINI_API_KEY": "your-gemini-api-key-here"
  34. }
  35. }
  36. }
  37. }
  38. ```
  39. **Option B: Without environment variable**
  40. ```json
  41. {
  42. "mcpServers": {
  43. "nano-banana": {
  44. "command": "npx",
  45. "args": ["nano-banana-mcp"]
  46. }
  47. }
  48. }
  49. ```
  50. ### Usage Examples:
  51. ```
  52. Generate an image of a sunset over mountains
  53. ```
  54. ```
  55. Edit this image to add some birds in the sky
  56. ```
  57. ```
  58. Continue editing to make it more dramatic
  59. ```
  60. ## 🎯 Usage with Cursor
  61. ### Configuration:
  62. Add to your Cursor MCP configuration:
  63. **Option A: With environment variable (Recommended)**
  64. ```json
  65. {
  66. "nano-banana": {
  67. "command": "npx",
  68. "args": ["nano-banana-mcp"],
  69. "env": {
  70. "GEMINI_API_KEY": "your-gemini-api-key-here"
  71. }
  72. }
  73. }
  74. ```
  75. **Option B: Without environment variable**
  76. ```json
  77. {
  78. "nano-banana": {
  79. "command": "npx",
  80. "args": ["nano-banana-mcp"]
  81. }
  82. }
  83. ```
  84. ### Usage Examples:
  85. - Ask Cursor to generate images for your app
  86. - Create mockups and prototypes
  87. - Generate assets for your projects
  88. ## 🔧 For Other MCP Clients
  89. If you're using a different MCP client, you can configure nano-banana-mcp using any of these methods:
  90. ### Configuration Methods
  91. **Method A: Environment Variable in MCP Config (Recommended)**
  92. ```json
  93. {
  94. "nano-banana": {
  95. "command": "npx",
  96. "args": ["nano-banana-mcp"],
  97. "env": {
  98. "GEMINI_API_KEY": "your-gemini-api-key-here"
  99. }
  100. }
  101. }
  102. ```
  103. **Method B: System Environment Variable**
  104. ```bash
  105. export GEMINI_API_KEY="your-gemini-api-key-here"
  106. npx nano-banana-mcp
  107. ```
  108. **Method C: Using the Configure Tool**
  109. ```bash
  110. npx nano-banana-mcp
  111. # The server will prompt you to configure when first used
  112. # This creates a local .nano-banana-config.json file
  113. ```
  114. ## 🛠️ Available Commands
  115. ### `generate_image`
  116. Create a new image from a text prompt.
  117. ```typescript
  118. generate_image({
  119. prompt: "A futuristic city at night with neon lights"
  120. })
  121. ```
  122. ### `edit_image`
  123. Edit a specific image file.
  124. ```typescript
  125. edit_image({
  126. imagePath: "/path/to/image.png",
  127. prompt: "Add a rainbow in the sky",
  128. referenceImages?: ["/path/to/reference.jpg"] // optional
  129. })
  130. ```
  131. ### `continue_editing`
  132. Continue editing the last generated/edited image.
  133. ```typescript
  134. continue_editing({
  135. prompt: "Make it more colorful",
  136. referenceImages?: ["/path/to/style.jpg"] // optional
  137. })
  138. ```
  139. ### `get_last_image_info`
  140. Get information about the last generated image.
  141. ```typescript
  142. get_last_image_info()
  143. ```
  144. ### `configure_gemini_token`
  145. Configure your Gemini API key.
  146. ```typescript
  147. configure_gemini_token({
  148. apiKey: "your-gemini-api-key"
  149. })
  150. ```
  151. ### `get_configuration_status`
  152. Check if the API key is configured.
  153. ```typescript
  154. get_configuration_status()
  155. ```
  156. ## ⚙️ Configuration Priority
  157. The MCP server loads your API key in the following priority order:
  158. 1. **🥇 MCP Configuration Environment Variables** (Highest Priority)
  159. - Set in your `claude_desktop_config.json` or MCP client config
  160. - Most secure as it's contained within the MCP configuration
  161. - Example: `"env": { "GEMINI_API_KEY": "your-key" }`
  162. 2. **🥈 System Environment Variables**
  163. - Set in your shell/system environment
  164. - Example: `export GEMINI_API_KEY="your-key"`
  165. 3. **🥉 Local Configuration File** (Lowest Priority)
  166. - Created when using the `configure_gemini_token` tool
  167. - Stored as `.nano-banana-config.json` in current directory
  168. - Automatically ignored by Git and NPM
  169. **💡 Recommendation**: Use Method 1 (MCP config env variables) for the best security and convenience.
  170. ## 📁 File Storage
  171. Images are automatically saved to platform-appropriate locations:
  172. - **Windows**: `%USERPROFILE%\\Documents\\nano-banana-images\\`
  173. - **macOS/Linux**: `./generated_imgs/` (in current directory)
  174. - **System directories**: `~/nano-banana-images/` (when run from system paths)
  175. File naming convention:
  176. - Generated images: `generated-[timestamp]-[id].png`
  177. - Edited images: `edited-[timestamp]-[id].png`
  178. ## 🎨 Example Workflows
  179. ### Basic Image Generation
  180. 1. `generate_image` - Create your base image
  181. 2. `continue_editing` - Refine and improve
  182. 3. `continue_editing` - Add final touches
  183. ### Style Transfer
  184. 1. `generate_image` - Create base content
  185. 2. `edit_image` - Use reference images for style
  186. 3. `continue_editing` - Fine-tune the result
  187. ### Iterative Design
  188. 1. `generate_image` - Start with a concept
  189. 2. `get_last_image_info` - Check current state
  190. 3. `continue_editing` - Make adjustments
  191. 4. Repeat until satisfied
  192. ## 🔧 Development
  193. This project was created with Claude Code and follows these technologies:
  194. - **TypeScript** - Type-safe development
  195. - **Node.js** - Runtime environment
  196. - **Zod** - Schema validation
  197. - **Google GenAI** - Image generation API
  198. - **MCP SDK** - Model Context Protocol
  199. ### Local Development
  200. ```bash
  201. # Clone the repository
  202. git clone https://github.com/claude-code/nano-banana-mcp.git
  203. cd nano-banana-mcp
  204. # Install dependencies
  205. npm install
  206. # Run in development mode
  207. npm run dev
  208. # Build for production
  209. npm run build
  210. # Run tests
  211. npm test
  212. ```
  213. ## 📋 Requirements
  214. - Node.js 18.0.0 or higher
  215. - Gemini API key from Google AI Studio
  216. - Compatible with Claude Code, Cursor, and other MCP clients
  217. ## 🤝 Contributing
  218. This project was generated by Claude Code, but contributions are welcome! Please feel free to:
  219. - Report bugs
  220. - Suggest new features
  221. - Submit pull requests
  222. - Improve documentation
  223. ## 📄 License
  224. MIT License - see [LICENSE](LICENSE) file for details.
  225. ## 🙏 Acknowledgments
  226. - **[Claude Code](https://claude.ai/code)** - For generating this entire project
  227. - **Google AI** - For the powerful Gemini 2.5 Flash Image API
  228. - **Anthropic** - For the Model Context Protocol
  229. - **Open Source Community** - For the amazing tools and libraries
  230. ## 📞 Support
  231. - 🐛 **Issues**: [GitHub Issues](https://github.com/claude-code/nano-banana-mcp/issues)
  232. - 📖 **Documentation**: This README and inline code comments
  233. - 💬 **Discussions**: [GitHub Discussions](https://github.com/claude-code/nano-banana-mcp/discussions)
  234. ---
  235. *✨ Generated with love by [Claude Code](https://claude.ai/code) - The future of AI-powered development is here!*

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.