Claude Code + NanoBanana MCP: Generate and Edit Images with Gemini AI Directly in the Terminal
📘 Complete Guide: Use All 11 AceData Cloud MCPs in Claude Code →
The biggest difference between NanoBanana and other AI image generation tools is that it truly understands image content. You can provide two images and have it place the objects from image A into the scene of image B. Underlying this is Google's Gemini model, which has strong image comprehension capabilities. Integrated with Claude Code, you can generate images, edit images, and compose multiple images with a single command in the terminal.
¶ Obtain API Token
Before using the NanoBanana MCP Server, you need an AceData Cloud API Token:
- Open the AceData Cloud Platform, which supports login via GitHub, Google, WeChat, email, or phone number. Registering grants free credits.
- After logging in, you can see the API Token on the homepage; click to copy it.
- When credits run out, go to Console → Recharge to top up, supporting Alipay, WeChat, and Stripe.

One Token grants access to all 11 MCP Servers; no need to apply separately for each service.
💡 Using claude.ai web or Claude Desktop? They support OAuth one-click authorization, so no need to manually enter the Token. See Claude + NanoBanana MCP Illustrated Tutorial for details.
¶ Configure Claude Code
Run the following command in the terminal, replacing 你的Token with the API Token you copied earlier:
claude mcp add nanobanana --transport http https://nanobanana.mcp.acedata.cloud/mcp \
-H "Authorization: Bearer 你的Token"
⚠️
-Hmust be uppercase. Lowercase-his--help, not a header parameter.
Without -s, the default scope is local, which only applies in the directory where the command is run. It is recommended to explicitly specify the scope:
| Scope | Command Parameter | Config File | Scope of Effect |
|---|---|---|---|
local (default) |
no -s or -s local |
~/.claude.json |
Only effective in the current project directory |
user |
-s user |
~/.claude.json |
Global effect, available in all projects |
project |
-s project |
.mcp.json in project root |
Current project, can be committed to git and shared with the team |
💡 To share the same configuration with your team, add
-s project: the config will be written to the project root.mcp.json. After committing to git, teammates can clone and use it. Do not commit real Tokens to public repos; use${ENV_VAR}placeholders plus environment variables instead.
To verify it’s effective, run claude mcp list and you should see nanobanana marked as ✓ Connected.
¶ Usage Examples
After configuration, you can directly call NanoBanana in Claude Code sessions using natural language:
Multi-image Composition
nanobanana_edit_image supports multiple image URLs as input, and Gemini understands the relationships between images:
Put the phone from the first image onto the desk in the second image, adjusting angle and lighting to make it look natural
Remove Text from Images
If you have an image with a watermark or unwanted text in a screenshot:
Edit this image to remove the text watermark in the bottom right corner, filling the background
Generate Page Illustration
Generate an illustration of a small dinosaur crouching next to a crack in the ground looking down, for use on a 404 page
¶ Tool List
| Tool | Description |
|---|---|
| nanobanana_generate_image | Text-to-image generation |
| nanobanana_edit_image | Image editing (supports multi-image input) |
