How to Add NanoBanana Image Editing to Claude Code with MCP

When you are already working in a terminal, switching to a browser just to generate or edit a product image breaks flow. A practical alternative is to connect an image MCP server to Claude Code, then ask for image work in the same place where you read code, edit files, and run commands.
This guide walks through the NanoBanana MCP setup for Claude Code using the public Ace Data Cloud documentation. The goal is not to replace your design process; it is to give your coding agent a callable image tool for common builder tasks: README visuals, landing page illustrations, product mockups, and multi-image composition.
What you can do
NanoBanana is useful when the task needs image understanding, not only fresh image generation. The documentation describes it as a tool that can understand relationships across images—for example, placing an item from one image into the scene of another and adjusting angle and lighting so the result looks natural.
In Claude Code, the NanoBanana MCP server exposes two tools:
nanobanana_generate_imagefor text-to-image generation.nanobanana_edit_imagefor image editing, including multiple image inputs.
That makes it a good fit for terminal-driven workflows where you want Claude Code to inspect project context, propose an asset, and call the image tool without leaving the session.
How it works
The setup is an HTTP MCP connection from Claude Code to the NanoBanana MCP endpoint:
https://nanobanana.mcp.acedata.cloud/mcp
Claude Code stores the MCP configuration locally, depending on the scope you choose. Requests include an authorization header in this form:
Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY
The documentation is careful about token handling: use a masked placeholder such as YOUR_ACEDATACLOUD_API_KEY in examples, screenshots, issues, and public repositories. Keep the real token in local configuration or a private environment-specific setup.
Choose the right Claude Code scope
Claude Code supports three setup scopes for this MCP server. The command shape is the same, but the final -s value changes how widely the configuration applies.
Project-only setup with local
Use local when you only want to test NanoBanana in the current project directory. The documentation says Claude Code writes this record into local ~/.claude.json along with the current project path.
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" -s local
User-wide setup with user
Use user if you expect to use image generation and editing across many projects. After this is configured, projects opened with Claude Code can see the NanoBanana MCP server.
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" -s user
Team-shared setup with project
Use project for a team repository. Claude Code writes the configuration into .mcp.json in the project root. The important caveat is that a real token should not be committed to a public repository. In a private team workflow, prefer a placeholder or have each developer add their own local credential.
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" -s project
One small but easy-to-miss detail: the header flag is uppercase -H. The lowercase -h is --help, so it will not configure the authorization header.
Verify the connection before asking for image work
After adding the MCP server, verify the handshake:
claude mcp list
If nanobanana shows ✓ Connected, the connection is ready. If it does not, check three things before debugging anything else: the token, the service URL, and the chosen configuration scope.
For project-level configuration, Claude Code may show Pending approval when it first reads the project configuration. That is a normal security step: approve the project configuration inside the Claude Code session before expecting tool calls to work.
Practical prompts to try
Once the server is connected, you can ask Claude Code for image tasks in normal language. Keep the prompt concrete and provide the image URLs when you want editing or composition.
For multi-image 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 tasks:
Edit this image to remove the text watermark in the lower right corner, filling it with the background.
For project illustrations:
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 point to a useful pattern: let Claude Code stay responsible for your project context, naming, and file placement, while NanoBanana handles the image operation through MCP.
A simple builder workflow
- Open the project in Claude Code.
- Add NanoBanana with
-s localfor a first test. - Run
claude mcp listand confirm✓ Connected. - Ask Claude Code to generate or edit a specific asset for your README, 404 page, or landing page.
- If the workflow becomes part of your daily setup, switch to
-s user; if it belongs to a private team project, consider-s projectwith a safe token strategy.
The nice thing about this setup is that it keeps image work close to the code. You can ask for a visual, review the result, and then have Claude Code update the relevant project files without turning the task into a browser-copy-paste loop.
For the full configuration reference and related examples, read the Ace Data Cloud documentation: Claude Code with Nano Banana MCP.
Comments
Post a Comment