How to Add NanoBanana Image Editing to Claude Code with MCP

How to Add NanoBanana Image Editing to Claude Code with MCP

If your workflow already lives in the terminal, switching to a browser just to edit a product screenshot or compose two reference images can break your focus. This guide shows how to connect NanoBanana MCP to Claude Code so image generation and image editing can sit next to code review, docs work, and release prep.

The goal is not to replace a design tool. It is to make small, useful visual tasks callable from the same Claude Code session where you are already reading files, writing copy, or preparing an implementation note.

What you can do

The NanoBanana MCP document describes two callable tools:

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

The most interesting part is composition. The docs explain that NanoBanana can understand relationships between images: for example, you can provide two image URLs and ask it to place an object from one image into the scene of another. That makes it useful for product mockups, documentation illustrations, visual QA notes, and lightweight marketing assets generated from real project context.

How it works

Claude Code connects to NanoBanana through a managed MCP server at https://nanobanana.mcp.acedata.cloud/mcp. The transport is HTTP, and authentication is passed as an uppercase -H header:

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

The uppercase -H matters. In the Claude Code command, lowercase -h is --help, so using the wrong flag will not add the authorization header.

Once the server is registered, Claude Code can call the NanoBanana tools from natural language. You do not need to paste a full API request into each conversation; you describe the visual task, and Claude Code routes it to the MCP tool when appropriate.

Choose the right scope

The same MCP server can be added with one of three scopes. Pick the smallest scope that matches your workflow.

  • -s local: use this for a first trial. The configuration is tied to the project directory where you run the command and is written into the local ~/.claude.json together with the current project path.
  • -s user: use this when you want NanoBanana available across projects. The user-level configuration is written into ~/.claude.json, and future Claude Code projects can see it.
  • -s project: use this for a team project. Claude Code writes the configuration into .mcp.json in the project root. The docs note that this can be committed to a private repository, but the real token should not be committed to public repositories.

For a shared setup, the command shape stays the same; only the scope changes:

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

When Claude Code reads a project-level MCP configuration for the first time, it may show Pending approval. That is expected; approve the project configuration inside the Claude Code session only if you trust the repository.

Verify the connection before using it

After adding the server, run:

claude mcp list

A working setup should show nanobanana with ✓ Connected. If it does not connect, check three things first: the token value, the MCP server URL, and the selected scope. The docs also recommend not relying on old client versions or fixed historical tool counts to decide whether the current setup is healthy.

Practical image-editing prompts

Once the connection works, keep prompts concrete. For composition, describe the role of each image and the visual constraints you care about:

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 work, be specific about what should disappear and how the background should be restored:

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

For documentation assets, you can ask for a new illustration directly:

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

These examples are intentionally small. A good builder workflow is to generate one useful visual, inspect it, then ask for a narrower edit. Treat the MCP tool as part of an iterative loop rather than a one-shot poster generator.

A safe setup pattern

For personal use, start with -s local. If you find yourself using the same image workflow across repos, move to -s user. For teams, use -s project only after deciding how each developer will provide their own token. The docs explicitly recommend keeping the real token in local configuration or private environment variables, and showing only masked placeholders such as YOUR_ACEDATACLOUD_API_KEY in public examples.

That pattern keeps the useful part of the workflow—Claude Code calling nanobanana_generate_image and nanobanana_edit_image—close to your project, without leaking credentials into issues, screenshots, or repositories.

Next step

If you already use Claude Code for implementation notes, README updates, or release prep, NanoBanana MCP is a practical way to add image editing to the same loop. Start with the local command, verify with claude mcp list, then try a two-image composition prompt on a non-sensitive asset.

Read the source documentation here: Claude Code with Nano Banana 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