How to Use NanoBanana MCP Inside Claude Code

How to Use NanoBanana MCP Inside Claude Code

When you are building inside a terminal, the awkward part of AI image work is usually not the prompt. It is the context switching: copy an image URL, open a separate tool, run an edit, bring the result back, and then continue writing or coding. The NanoBanana MCP setup for Claude Code is useful because it keeps image generation and image editing inside the same terminal workflow.

What you can do

The Ace Data Cloud NanoBanana MCP server gives Claude Code two direct image tools:

  • nanobanana_generate_image for text-to-image generation.
  • nanobanana_edit_image for image editing, including multiple image inputs.

The practical difference is that NanoBanana is designed around image understanding, not only drawing from a blank prompt. The source documentation describes using Google Gemini at the core, so the workflow is especially helpful when Claude Code needs to reason about existing images: placing an object from one image into another scene, removing text from a screenshot, or creating a page illustration from a short description.

How it works

MCP, or Model Context Protocol, lets Claude Code call external tools from a running terminal session. In this setup, Claude Code connects over HTTP to the hosted NanoBanana MCP endpoint:

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

Authentication is passed with an Authorization header. The documentation shows a placeholder token format and explicitly recommends not pasting a complete token into public repositories, issues, screenshots, or chat records. Use a masked placeholder such as YOUR_ACEDATACLOUD_API_KEY in docs and examples, and keep the real token local.

Step 1: Add the MCP server to Claude Code

The core command is claude mcp add. One easy way to test is to bind the server to the current project only with the local scope:

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

Two details are worth getting right. First, -H must be uppercase; lowercase -h is the help flag. Second, choose the scope intentionally:

  • -s local: good for a trial inside one project directory.
  • -s user: useful when you want NanoBanana available across projects.
  • -s project: writes project-level configuration into .mcp.json so a team can share the setup pattern.

If you use -s project, do not commit a real token to a public repository. The documentation recommends using a placeholder or having each teammate add credentials locally. Claude Code may also show Pending approval the first time it reads a project-level MCP configuration; that is a normal trust prompt.

Step 2: Verify the connection

After adding the server, check the MCP list:

claude mcp list

If nanobanana appears with ✓ Connected, the handshake worked. If it does not, debug the three things the documentation calls out: token, service URL, and configuration scope. Avoid assuming a fixed tool count from an older client version; the reliable signal is the current connection status.

Step 3: Use it for real builder workflows

Once connected, you do not have to hand-write a tool call. Ask Claude Code in natural language, and it can choose the NanoBanana tool based on the task.

Compose two images

For product mockups or design iteration, the most useful pattern is multi-image composition. For example:

Place the phone from the first image onto the desk in the second image, adjusting the angle and lighting to make it look natural.

This maps to the documented nanobanana_edit_image capability, which supports multiple image URLs and lets the model reason about the relationship between images.

Clean up screenshots or assets

If you have a screenshot with unwanted text, you can keep the request direct:

Edit this image to remove the text watermark in the lower right corner, filling it with the background.

This is useful when preparing documentation images, release notes, or internal demos. The important habit is to describe what should change and what should stay unchanged.

Generate small illustrations while writing

For lightweight UI states, you can ask for a generated image without leaving Claude Code:

Generate an illustration of a small dinosaur squatting next to a crack in the ground looking down, to be used for a 404 page.

That kind of request fits nanobanana_generate_image: no source image is required, just a concrete visual description and the intended use.

A practical way to adopt it

Start with -s local in a disposable project and verify that claude mcp list shows ✓ Connected. Then try one edit with two image URLs and one text-to-image illustration. If the workflow becomes part of your daily documentation or product work, move the configuration to -s user. For teams, use -s project only after you have agreed on a safe token-handling pattern.

The full source guide is here: 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