Integrating Cursor with NanoBanana MCP

NanoBanana is a little different from other AI image generation tools—it doesn't just "draw a new image"; its greater strength is "editing an old image." It uses Google's Gemini model under the hood, truly understands image content, and can make precise edits.

The most practical capability: give it two images and have it place the product from image A onto the background of image B, or redraw image B in the style of image A. Now, through the MCP protocol, you can invoke it in Cursor with a single sentence.

Get an API Token

Log in to the application list, open General Application, and click the copy button to the right of API KEY.

Get an Ace Data Cloud API Key

If your balance is insufficient, click the "Recharge" button.

One Token can be used for all MCP Servers; there is no need to apply for each service separately.

Configure Cursor

Create .cursor/mcp.json in the project root directory:

{
  "mcpServers": {
    "nanobanana": {
      "type": "http",
      "url": "https://nanobanana.mcp.acedata.cloud/mcp",
      "headers": {
        "Authorization": "Bearer 你的Token"
      }
    }
  }
}

After saving, restart Cursor, and you can use NanoBanana's image generation and editing features in Agent mode.

Real Development Scenarios

"Make this screenshot look better"

You took an ugly terminal screenshot and want to put it in your blog, but it looks too plain:

> 编辑这张图片,添加一个圆角阴影的窗口装饰,背景换成浅灰色渐变

Multi-image composition

The product manager gives you a product image and a scene image and asks you to combine them into a rendering of "the product being used in the scene":

> 把第一张图中的手机放到第二张图的桌面上,调整大小和透视角度让它看起来自然

nanobanana_edit_image supports passing in multiple image URLs, and the AI understands the relationships between the images.

Fun illustrations for 404 pages and more

> 生成一只小恐龙趴在破碎的地面裂缝边上往下看的插画,用作 404 页面

The NanoBanana Pro model produces good-quality illustrations in a variety of styles.

Tool List

Tool Description
nanobanana_generate_image Generate images from text
nanobanana_edit_image Edit images (supports multiple image inputs)

Configuration for Other Editors

  • VS Code — .vscode/mcp.json, with the same configuration under servers
  • Claude Code — Configure via the terminal command line; see the Claude Code + NanoBanana MCP tutorial for details
  • Claude Desktop — Configuration file paths: macOS ~/Library/Application Support/Claude/claude_desktop_config.json, Windows %APPDATA%\Claude\claude_desktop_config.json; use the mcpServers format