How to Use NanoBanana MCP in Claude Code for Image Generation and Editing

If your terminal-based coding workflow keeps getting interrupted whenever you need a product mockup, a cleaned-up screenshot, or a small illustration for documentation, connecting Claude Code to an image MCP server can keep that work inside the same loop.
What you can do
The NanoBanana MCP integration for Claude Code gives your coding assistant two concrete image capabilities from the terminal:
nanobanana_generate_imagefor text-to-image generation.nanobanana_edit_imagefor image editing, including workflows that pass multiple image URLs as input.
The useful part is not only generating a picture from a prompt. The documentation emphasizes image understanding: you can ask the model to take an item from one image and place it naturally into the scene of another image, adjusting angle and lighting. That makes it a practical fit for product-background changes, composing assets for documentation, or turning a quick idea into a visual that belongs in your project.
How it works
Claude Code already knows how to inspect a project, edit files, run commands, and explain errors. MCP extends that session with external tools. In this case, Claude Code talks to the NanoBanana MCP endpoint:
https://nanobanana.mcp.acedata.cloud/mcp
The endpoint is added as an HTTP MCP server. Authentication is passed with an Authorization: Bearer header. The docs are explicit about one easy-to-miss detail: the -H flag must be uppercase. Lowercase -h means --help, which is not what you want when registering the server.
You only need an Ace Data Cloud API token for the MCP server. In examples and shared documentation, keep it masked as YOUR_ACEDATACLOUD_API_KEY. Do not paste a real token into public repositories, screenshots, issues, or chat logs.
Configure it for one project
For a first test, use the local scope. This binds the configuration to the current project directory where you run the command. Claude Code records it in the local ~/.claude.json together with the project path.
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" -s local
This is the safest way to try the integration because it avoids making the server available everywhere before you have confirmed the workflow fits your project.
Make it available across projects
If you use image generation or editing frequently across multiple repositories, use the user scope. The command is almost identical; only the scope changes:
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" -s user
After that, any project opened with Claude Code can see the nanobanana MCP server from your user-level configuration.
Share a project-level setup carefully
For team projects, Claude Code also supports the project scope. This writes the configuration into .mcp.json in the current project root:
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" -s project
This can be useful in a private repository when several teammates need the same MCP server. The important rule is to avoid committing a real token. Use an environment-variable placeholder or let each developer add their own local credential. When Claude Code reads a project-level configuration for the first time, it may show Pending approval; approving trust for the project configuration is expected behavior.
Verify the connection
Once the server is registered, check the active MCP list:
claude mcp list
If nanobanana shows ✓ Connected, the handshake succeeded. If it does not, the docs suggest checking three things before assuming the server is unavailable: the token, the service URL, and the configuration scope.
Use it like a builder, not a prompt tourist
The best workflow is to give Claude Code the context and the intended use. For example, when composing two images, you can say:
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 documented pattern is just as direct:
Edit this image to remove the text watermark in the lower right corner, filling it with the background.
And for small web UI assets, you can stay descriptive without leaving the terminal:
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 ordinary. The value is not in a magic prompt; it is in keeping the image task close to the project context, where Claude Code can help name files, update docs, or prepare the next commit.
Where to go next
Start with -s local, verify ✓ Connected, then decide whether user or project scope fits your workflow. The full NanoBanana MCP setup notes are available in the Claude Code with NanoBanana MCP documentation.
Comments
Post a Comment