How to Add NanoBanana Image Editing to Claude Code with MCP

If your coding agent can edit files but still needs you to leave the terminal whenever a README image, product mockup, or visual asset changes, MCP is a clean way to close that gap.
What you can do
The NanoBanana MCP guide for Claude Code describes a focused workflow: connect Claude Code to the managed NanoBanana MCP server, then ask for image generation, image editing, or multi-image composition from the same terminal session where you are already working on code.
This is useful when the visual task is part of a developer workflow rather than a standalone design session. For example, you might be updating a landing page, writing release notes, polishing a 404 page, or preparing product screenshots. Instead of switching tools, you can let Claude Code keep project context and call the image tool when needed.
- Generate a new image from a prompt with
nanobanana_generate_image. - Edit an existing image with
nanobanana_edit_image. - Pass multiple image URLs to compose or transfer objects between images.
- Keep the configuration scoped to one project, all projects, or a shared project file.
How it works
Claude Code already understands code, files, shell commands, and error output. MCP adds callable external tools to that environment. In this case, Ace Data Cloud hosts the NanoBanana MCP endpoint, and Claude Code talks to it over HTTP with an authorization header.
The endpoint shown in the guide is:
https://nanobanana.mcp.acedata.cloud/mcp
The server is added with claude mcp add, the transport is http, and authentication is passed with an uppercase -H header. The documentation explicitly notes that lowercase -h is help, so keep -H uppercase.
Choose the right scope
The guide gives three configuration scopes. The right one depends on how repeatable the image workflow is.
Use local for a trial or one repository
The local scope is bound to the project directory where you run the command. Claude Code writes the record into the local ~/.claude.json with the current project path. It is a good default when you want to test the handshake without affecting 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
Use user when image work is part of your daily loop
If you often need visual assets across repositories, use the user scope. The configuration is still written locally, but any project opened with Claude Code afterward can see the NanoBanana server.
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" -s user
Use project for team configuration
The project scope writes configuration into .mcp.json in the current project root. That can be useful for a private team repository where everyone needs the same MCP server name and endpoint. Do not commit real tokens to public repositories; use a placeholder or have each teammate add their own local secret. When Claude Code reads a project-level configuration for the first time, it may show Pending approval. The guide describes this as a normal trust prompt.
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" -s project
Verify the connection before asking for images
Before you build a workflow around the tool, run the MCP list command:
claude mcp list
If nanobanana shows ✓ Connected, the handshake succeeded. If it does not, check the token, the service URL, and the scope you used. The guide also warns not to judge the current state by historical client versions or fixed tool counts, because MCP clients and servers can change over time.
Practical prompts that fit developer work
Once connected, the most natural interface is not a raw API request. It is a specific instruction inside Claude Code, ideally attached to a task you are already doing.
For multi-image composition, the documented pattern is to pass multiple image URLs and let NanoBanana understand the relationship between them:
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, the guide gives the example of removing unwanted text from an image:
Edit this image to remove the text watermark in the lower right corner, filling it with the background.
For product or web UI work, you can ask Claude Code to generate a page illustration and then update the relevant asset reference in your project:
Generate an illustration of a small dinosaur squatting next to a crack in the ground looking down, to be used for a 404 page.
A simple builder workflow
- Start in a feature branch where the image is needed.
- Add NanoBanana with
-s localfirst, unless you already know it belongs in every project. - Run
claude mcp listand confirm✓ Connected. - Give Claude Code the design context: target file, existing image URL, desired dimensions, and where the asset will be used.
- Ask for the edit or generation, then review the result like any other generated artifact before committing.
The value is not that the terminal replaces a designer. It is that small visual tasks stop interrupting the development loop. Claude Code can keep the repository context, call nanobanana_generate_image or nanobanana_edit_image, and help you wire the output back into the project.
Read the full setup notes in the Claude Code with NanoBanana MCP guide.
Comments
Post a Comment