How to Add NanoBanana Image Editing to Claude Code with MCP

How to Add NanoBanana Image Editing to Claude Code with MCP

When you are building a feature, writing docs, or polishing a demo, image work often breaks your flow: you leave the terminal, open a separate product, upload assets, copy results back, and then return to the codebase. NanoBanana MCP gives Claude Code a direct image generation and editing tool inside the same terminal session, so you can ask for visuals while Claude still has your project context.

What you can do

The documented NanoBanana MCP setup exposes two tools to Claude Code:

  • nanobanana_generate_image for text-to-image generation.
  • nanobanana_edit_image for image editing, including workflows with multiple input images.

The practical difference from a standalone drawing app is that Claude Code can call these tools while you are already working in a repository. For example, you can ask it to create a 404-page illustration, remove unwanted text from an image, or combine objects from one image with the scene of another. The source guide describes NanoBanana as using Google Gemini at its core, with image understanding strong enough to reason about relationships between images.

How it works

The setup is a remote MCP server configuration. Claude Code talks to the NanoBanana MCP endpoint over HTTP, and the request is authorized with an Ace Data Cloud API token. The endpoint in the documentation is:

https://nanobanana.mcp.acedata.cloud/mcp

You do not need a separate token specifically for NanoBanana. The documentation says one Ace Data Cloud API token can be used for all MCP servers provided by Ace Data Cloud. The important operational rule is simple: keep the real token local, do not paste it into public repositories, issues, screenshots, or chat records, and use placeholders such as YOUR_ACEDATACLOUD_API_KEY in shared examples.

Choose the right Claude Code scope

Claude Code supports three configuration scopes for this MCP server. The command shape is the same; only the -s value changes.

  • local: bind the MCP server to the current project directory. This is a good first test because it limits the configuration to the project where you run the command.
  • user: make the server available across projects opened with Claude Code. Use this if image generation and editing is part of your regular workflow.
  • project: write configuration into the project-level .mcp.json. This is useful for team projects, but the real token should not be committed to a public repository.

The guide also notes that a project-level configuration may appear as Pending approval the first time Claude Code reads it. That is a normal security prompt; confirm trust from inside the Claude Code session before using the server.

Configure NanoBanana for the current project

For a first run, I would start with the local scope. It proves the endpoint, token, and client configuration without changing every project on your machine.

claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp   -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY"   -s local

Two small details matter. First, -H must be uppercase; lowercase -h means --help. Second, replace only the token placeholder after Authorization: Bearer. Keep the URL and transport exactly as shown unless the documentation changes.

If you want the same server available in every project, use the documented user scope:

claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp   -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY"   -s user

For a team repository, the documented project-level form is:

claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp   -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY"   -s project

In team settings, treat that command as a pattern rather than a secret-bearing artifact. Use an environment-variable placeholder or have each teammate add their own token locally.

Verify the connection before asking for images

After adding the server, run the documented verification command:

claude mcp list

If nanobanana shows ✓ Connected, the handshake worked. If it does not, check the token, service URL, and selected configuration scope. The guide explicitly recommends not judging the current status from historical Claude Code client versions or fixed tool counts, because the client and server surface can change over time.

Use it like a builder, not like a prompt gallery

Once connected, the best workflow is to ask Claude Code for the visual asset in the same language you would use with a teammate. The documented examples are practical:

  • For composition: Place the phone from the first image onto the desk in the second image, adjusting the angle and lighting to make it look natural.
  • For cleanup: Edit this image to remove the text watermark in the lower right corner, filling it with the background.
  • For product or docs work: Generate an illustration of a small dinosaur squatting next to a crack in the ground looking down, to be used for a 404 page.

What makes this useful is not only the image model. It is the fact that Claude Code already knows the surrounding task: the README you are editing, the route that needs an empty-state illustration, or the product page that needs a more consistent visual. The MCP server becomes a callable tool arm inside that context.

Where this fits in a real workflow

I would use NanoBanana MCP for assets that are tied to code or documentation: 404 illustrations, README diagrams, product screenshots that need cleanup, and small composite images for release notes. Keep prompts specific about source image order, desired object placement, lighting, and what should remain unchanged. When multiple source images are involved, describe each one by role: “the first image is the product,” “the second image is the background,” and then state the transformation.

The setup is intentionally small: one MCP endpoint, one bearer token header, one verification command, and two available tools. That makes it easy to test in one repository first, then promote to a user-level configuration if it becomes part of your normal build loop.

For the full command reference and related Claude Code notes, read the source guide: Claude Code with NanoBanana MCP.

Comments

Popular posts from this blog

Artistic QR Code API Integration Guidance

How to Configure Claude Code with CC Switch and Ace Data Cloud

How to Build a Server-Side Image Editing Workflow with GPT-Image-2