Large Language ModelsGenerate imagesGenerate videos
Nano Banana MCP for Claude Code: Setup, Skill and Pricing
Connect a Nano Banana MCP server to Claude Code in a few commands, protect your Gemini token, write a SKILL.md that keeps prompts consistent, and compare real per-image prices across Nano Banana, Nano Banana 2 Lite, 2 and Pro for a 120-image month.
Your coding agent can scaffold a landing page in a minute, then stall because the hero image does not exist yet. A Nano Banana MCP server closes that gap. You register it once in Claude Code, ask for a picture in plain English, and the file lands in your project folder while you keep working. Below you get the exact setup commands, a reusable skill file, a safety checklist, and the per-image prices published in October 2026, so you can decide in ten minutes whether it earns a spot in your toolchain.
What Nano Banana Actually Is
"Nano Banana" began as the nickname for Google's Gemini 2.5 Flash Image model and stuck as the brand for the whole line. These are the four names you will meet in price lists:
Claude Code already reads your repo, edits files, and runs commands. It cannot paint. An image server hands it a generate_image tool, so the session that writes the component also produces the hero shot, the social card, and the empty-state illustration, then wires them in by file path. No tab switching, no download folder, no renaming image (3).png.
Typical jobs that fit:
Hero and blog images generated beside the page that uses them
Product mockups placed in different rooms, seasons, and lighting
Edits to existing photos: swap a background, fix the light, remove a distraction
Placeholder art for prototypes that gets replaced later
What It Does Well, and Badly
It follows long, descriptive prompts closely, holds a subject steady across several edits, and renders short text legibly. Nano Banana 2 can also ground a prompt in live web search, which helps when a picture should match something that happened this week.
It is weaker at dense typography, exact brand colors, and keeping the same face identical across fifty images. Treat the first result as a draft and budget for a second pass.
How the MCP Link Works
The Model Context Protocol is an open standard that lets an AI client call outside tools. Three pieces are involved:
Claude Code, the client that decides when a tool is needed.
The MCP server, a small Node or Python process on your machine that Claude Code launches on demand.
Google's Gemini API, where the image is actually generated.
You ask for an image. Claude Code calls a tool named like mcp__nanobanana__generate_image. The server sends your prompt to a Gemini image model, saves the result to disk, and replies with a file path. That last step matters more than it looks.
💡 Why paths beat raw data: Claude Code limits how much output an MCP tool may return (you can raise the limit with the MAX_MCP_OUTPUT_TOKENS environment variable). A base64 image would burn through context fast. The @nanobanana/mcp listing says it returns file paths instead, which keeps your session lean.
Which Server Should You Pick
Several community servers exist. None of them come from Anthropic or Google.
Server
Auth
Tools
Worth knowing
@nanobanana/mcp
Gemini token
generate_image, edit_image, list_models
Defaults to Nano Banana 2, returns file paths
@ycse/nanobanana-mcp
Google AI token
gemini_generate_image, gemini_edit_image, gemini_chat, set_model, plus history tools
MIT license, switches between Flash and Pro
nano_banana via OpenRouter
OpenRouter token
Image generation
Defaults to google/gemini-3-pro-image-preview
The examples below use @nanobanana/mcp because it is the simplest: three tools and one variable. The others work the same way, with a different package name and variable.
Setup in Five Minutes
Get a Gemini Token
Open the API page in Google AI Studio (aistudio.google.com/apikey) and create a token. A free tier exists, but pricing roundups note that free-tier generations may be used by Google to improve its products. Use a paid project for client work or private images.
Register the Server
On macOS, Linux, or WSL, run:
claude mcp add nanobanana -e GEMINI_API_KEY=your_token_here -- npx -y @nanobanana/mcp
Native Windows needs the cmd /c wrapper so Claude Code can launch npx:
You also choose a scope. Local is the default and applies to you in this project. Add --scope project to write a shared .mcp.json the whole team uses, or --scope user to make the server available in every project.
💡 Put every flag before the double dash. Anything after it goes to npx, not to Claude Code, and that is the most common reason a fresh server never connects.
Check the Connection
Run claude mcp list, then open Claude Code and type /mcp. The nanobanana entry should read connected. Now test it with a real request:
Generate a 16:9 photo of a ripe banana on a wooden desk in morning window light, and save it to public/images/test.jpg
If a file path comes back and the image opens, the link works. The first call can take longer because npx downloads the package; later calls start faster.
Keep Secrets Out of Chat
Your token belongs in an environment variable and nowhere else. Never paste it into a prompt, a skill file, or a committed config. For a shared .mcp.json, reference the variable instead of the value:
Claude Code expands the variable from your shell when it starts the server, so each teammate uses their own token and the repo stays clean.
💡 These servers are community projects. npx -y downloads and runs code with your token in its environment. Open the repository, check the maintainer and the recent commits, and pin a version (@nanobanana/mcp@<version>) before you trust it.
Build a Skill Around It
The server gives Claude Code the ability to draw. A skill tells it how you want things drawn. A skill is a folder holding a SKILL.md file, kept at .claude/skills/nano-banana/ for one project or ~/.claude/skills/nano-banana/ for all of them. The file opens with a short YAML header carrying two fields, name and description. Claude reads the description to decide when the skill applies and loads the body only then, so the skill costs almost nothing until it is needed.
What Goes Inside SKILL.md
Write the description as a trigger: "Generate or edit images with the Nano Banana MCP server. Use when the user asks for a hero image, thumbnail, mockup, or illustration." Then put your rules in the body:
# Nano Banana image rules
1. Write one prompt before calling the tool: subject, action, setting, camera and lens, lighting, mood.
2. Describe what should be in the frame. Do not list things to avoid.
3. Use 16:9 for hero images and 1:1 for thumbnails.
4. Save files in public/images/ with a kebab-case name that matches the page slug.
5. Generate one image, check it, then ask before making variations.
6. Never request more than 4 images in one turn without confirmation.
7. Add descriptive alt text wherever an image is used.
8. Never print, log, or commit the API token.
Rules 5 and 6 matter most. They are your cost brakes, and the next section shows why.
A real session then looks like this: you say "add a hero image to the pricing page." Claude Code reads the page, loads the skill, writes a single detailed prompt, calls generate_image, receives a path, and edits the <img> tag with alt text. You review one picture instead of eight.
A Prompt Formula That Works
Use this order: subject, action, setting, lighting, camera, texture. For example:
A baker pulling a tray of sourdough from a stone oven, flour dusting her forearms, rustic kitchen with copper pans, warm window light from the left, 50mm lens at f/2, shallow depth of field, visible crust texture, natural color.
Keep any text inside the image to one or two words. For edits, ask for a single change per instruction ("make the sky overcast"), check the result, then ask for the next one.
What It Really Costs
The image model is only one line of your bill. Claude Code usage is billed separately through your Anthropic plan or API usage, and Google bills the Gemini side.
Per-Image Prices by Model
Public pricing trackers list these figures as of October 2026:
Prices move, so confirm them on Google's pricing page before you commit a budget. Some trackers also add a charge per uploaded reference image, which means heavy editing jobs cost more than the output price suggests.
A 120-Image Monthly Budget
Picture a blog that ships 20 articles a month with 6 images each:
These totals assume you keep every image. If you reject half, double them. Three habits keep the number low:
Draft cheap, finish premium. Iterate on the original or Lite model and render only the winner on Pro.
Batch whatever can wait. Batch pricing is half the standard rate in the trackers above.
Cap the loop. Rules 5 and 6 in your skill stop Claude from producing a dozen unrequested variations.
Fixing Common Problems
Server Shows Failed or Missing
Work through these in order:
Run claude mcp get nanobanana to see the command and environment Claude Code stored.
Run node --version. The server needs Node installed for npx to work.
On native Windows, make sure the command is cmd /c npx.
Re-add the server with the -e flag before the double dash.
Restart your Claude Code session. Servers load at startup.
Images Arrive but Look Wrong
Vague prompts give stock-photo results, so add a lens, a light direction, and one texture detail. Garbled text means too many words: cut it to one or two. A wrong shape usually means the aspect ratio never reached the tool, so state it in the request. When an edit drifts, change one thing at a time and keep the good version before the next pass.
How to Use Nano Banana on PicassoIA
If you would rather skip the token and the terminal, Nano Banana 2 runs in your browser on Picasso IA. The model page lists unlimited generations with no per-generation credits, which makes it a handy place to test prompts before you pay for API calls. The example runs on that page finished in roughly 20 to 28 seconds each, so iterating is cheap in time as well as money.
Nano Banana 2 Step by Step
Open the model page and click into the prompt box.
Write the scene as full sentences: subject, setting, light, lens.
Optionally upload up to 14 reference images to blend looks or keep a character consistent.
Pick an aspect ratio. The default is match_input_image, and 15 options are available, including 16:9, 9:16, 4:5, and 21:9.
Choose a resolution: 1K by default, with 2K and 4K available. Higher settings take longer.
Select jpg or png output.
Switch on Google Search or Image Search grounding when the picture should reflect current events or real places.
Generate, then refine by typing a follow-up such as "make the background overcast" instead of rewriting the whole prompt.
When to Pick Pro
Nano Banana Pro also accepts 14 reference images, outputs at 1K, 2K (the default), or 4K, and adds a safety_filter_level setting. Its page lists it as free to use, and its example runs took anywhere from 18 to 113 seconds, so expect it to be slower. Reach for it when a final hero image needs maximum detail, and use Nano Banana for quick edits.
Prompt writing can be delegated too. A chat model such as Claude Sonnet 5 can turn a rough idea into the subject, action, lighting formula, while Claude Opus 4.7 suits longer briefs. When a scene should move, describe the motion for a short clip in Veo 3.1 Fast or Gemini Omni 1.1.
Try Your First Image Today
You now have the full loop: a token, one claude mcp add command, a skill that keeps prompts consistent, and a budget you can defend. The fastest way to feel the difference between models is to run the same prompt through each of them.
Open Picasso IA, pick Nano Banana 2, and paste the baker prompt from above. Then change one detail, the lens or the light, and generate again. Ten minutes of that will teach your skill file more than any rulebook. Start with a single scene you actually need this week, and build from there.