YN

ycse/nanobanana-mcp

Productivity workflow

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

32 stars 6 forks Качество 75 Тренд 11MIT

Gemini Vision & Image Generation MCP for Claude Desktop and Claude Code

Обзор

MCP server that brings Gemini's image generation and editing capabilities to Claude Desktop, Claude Code, and Cursor. Supports (Flash) and models. - - Create 2K images from text prompts - - Transform images with natural language instructions - - Maintain style/character across generations - - Switch between Flash and Pro models without restart - - Conversational context with image support - Node.js 18+ - Google AI API Key (Get one here) Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows): Create or edit .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global): See Cursor MCP Documentation for more details. Must be called before generating or editing images. Switch models per-session without restarting:

README

Показан фрагмент оригинального README. Открыть оригинал.

NanoBanana MCP

MCP server that brings Gemini’s image generation and editing capabilities to Claude Desktop, Claude Code, and Cursor. Supports Nano Banana 2 (Flash) and Nano Banana Pro models.

Features

  • Image Generation - Create 2K images from text prompts
  • Image Editing - Transform images with natural language instructions
  • Session Consistency - Maintain style/character across generations
  • Runtime Model Switching - Switch between Flash and Pro models without restart
  • Multi-turn Chat - Conversational context with image support

Quick Start

Prerequisites

Add to Claude Code

claude mcp add nanobanana-mcp -- npx -y @ycse/nanobanana-mcp \
  -e "GOOGLE_AI_API_KEY=your_api_key"

Add to Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "nanobanana-mcp": {
      "command": "npx",
      "args": ["-y", "@ycse/nanobanana-mcp"],
      "env": {
        "GOOGLE_AI_API_KEY": "your_api_key"
      }
    }
  }
}

Add to Cursor

Create or edit .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "nanobanana-mcp": {
      "command": "npx",
      "args": ["-y", "@ycse/nanobanana-mcp"],
      "env": {
        "GOOGLE_AI_API_KEY": "your_api_key"
      }
    }
  }
}

See Cursor MCP Documentation for more details.

Tools

Tool Purpose
set_aspect_ratio Required. Set aspect ratio before image generation
set_model Switch between flash/pro models at runtime
gemini_generate_image Generate images from text prompts
gemini_edit_image Edit images with natural language
gemini_chat Multi-turn conversation with images
get_image_history View session image history
clear_conversation Reset session context

set_aspect_ratio (Required)

Must be called before generating or editing images.

Valid ratios: 1:1, 9:16, 16:9, 3:4, 4:3, 3:2, 2:3, 5:4, 4:5, 21:9

set_model

Switch models per-session without restarting:

Value Model Description
flash gemini-3.1-flash-image-preview Nano Banana 2 - Faster (default)
pro gemini-3-pro-image-preview Nano Banana Pro - Higher quality

gemini_generate_image

{
  prompt: string;              // Image description
Открыть полный README на GitHub

Установка

npx -y @ycse/nanobanana-mcp
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "nanobanana-mcp": { "command": "npx", "args": ["-y", "@ycse/nanobanana-mcp"], "env": { "GOOGLE_AI_API_KEY": "your_api_key" } } } }