MCP server and CLI

Nano Banana MCP & CLI

Generate images and videos with Nano Banana Pro, Seedream, GPT Image, Seedance and more, right inside Claude Code, Cursor and Codex. Your agent uses the credits and plan you already have.

Set it up in one step

  • Claude Code
  • Cursor
  • Codex

Paste this message into your agent and it will install and sign in for you.

Prefer to configure it yourself? See setup options

No separate API billing. Works with your existing Nano Banana account.

Connect your agent

Pick your client. Local MCP runs through npx and reuses your CLI login. Remote MCP needs an API token in the Authorization header.

Run in your terminal

claude mcp add nanobananana -- npx -y @nanobananana/cli@latest mcp

The first time a tool runs, sign in with npx -y @nanobananana/cli@latest auth login, or set NANOBANANANA_TOKEN.

Get started in three steps

Install once, sign in from your browser, then ask your agent for what you need.

  1. 01

    Add the MCP server

    One command adds Nano Banana to Claude Code. Cursor and Codex take a short config entry.

    claude mcp add nanobananana -- npx -y @nanobananana/cli@latest mcp
  2. 02

    Sign in

    A browser window opens. Approve access and the CLI saves a token on your machine.

    npx -y @nanobananana/cli@latest auth login
  3. 03

    Generate

    Ask your agent for an image or video, or run the CLI yourself. Results download into your project.

    nanobanana generate create nano-banana-pro --prompt "a banana astronaut" --wait

Tools your agent can use

Nine focused tools cover the whole workflow, from picking a model to downloading results.

  • nano_account_status

    Your email, plan, credit balance, unlimited models and how many unlimited images are left today.

  • nano_list_models

    Image and video models with a short description and starting price, filterable by type.

  • nano_get_model

    Every parameter of a model: types, allowed values, ranges and which options work together.

  • nano_estimate_cost

    The exact credit cost for a set of parameters, or why the combination is invalid.

  • nano_upload_image

    Upload a reference image from an HTTPS link, or a local file with the local MCP.

  • nano_generate_image

    Start an image generation and get a request ID plus the credits charged.

  • nano_generate_video

    Start a video generation with the same options as the website.

  • nano_get_generation

    Check a generation, waiting up to 20 seconds, and get result URLs once it is done.

  • nano_list_generations

    Your recent generations, page by page.

Prefer the terminal?

Everything also works as plain commands. Every command supports --json, so it fits into scripts and CI.

nanobanana model list --type text_to_image
nanobanana model get nano-banana-pro
nanobanana generate cost nano-banana-pro --prompt "a cozy reading nook" --resolution 2K
nanobanana generate create nano-banana-pro --prompt "a cozy reading nook" --resolution 2K --wait --out ./out
nanobanana generate create seedance --prompt "waves at sunset" --image ./frame.png --wait
nanobanana generate list --limit 20 --json

How billing works

Agents use your Nano Banana account, not a separate API balance.

Same credits as the website

Each generation deducts credits from your account at the same price as on nanobananana.com. Failed generations are refunded.

Unlimited stays unlimited

On Plus and Ultra, Z Image and FLUX.2 stay unlimited. Through a token they are capped at 300 images per day to stop runaway scripts.

Check the price first

Your agent can call nano_estimate_cost before generating, and it must choose a resolution explicitly instead of picking a pricier one for you.

Need more credits? See plans and credit packs

Frequently asked questions

A token can only generate, upload reference images and read your generations and balance. It cannot change your password, delete your account, buy plans or open support tickets. Prompts sent with a token go through the same content moderation as the website.

Bring Nano Banana into your agent

Create a token, paste the config and start generating from your editor.

Create an API token
Share this page