For developers
Nano Banana Pro MCP server
Let your AI assistant create images and videos on your behalf. Add one server address to a client that supports the Model Context Protocol, sign in to your account in the browser, and describe what you need in plain language.
How it works
Add the server address
Paste the address below into your client, using its command, its configuration file or its custom connector field.
MCP server address
https://preview.bananapro.site/api/mcpSign in and allow access
The client opens a browser window. Sign in to your Nano Banana Pro account and press Allow. No API key has to be typed.
Describe what you need
Ask for an image or a video in the conversation. The assistant chooses a tool, starts the task and returns the result links.
Setup by client
Choose your client. Menu names can differ slightly between versions.
Claude Code
- 1Run the command below in a terminal to add the server.
- 2In Claude Code, open /mcp, select nanobanana and finish the sign-in in the browser.
claude mcp add --transport http nanobanana https://preview.bananapro.site/api/mcpCodex
- 1Run the first command in a terminal to add the server.
- 2Run the second command. A browser window opens.
- 3Sign in to your account and press Allow.
codex mcp add nanobanana --url https://preview.bananapro.site/api/mcpcodex mcp login nanobananaCursor and JSON clients
- 1Add the following to the MCP configuration file of the client, for example mcp.json in Cursor.
- 2Restart the client if needed. On first use it opens a browser window: sign in and press Allow.
{
"mcpServers": {
"nanobanana": {
"url": "https://preview.bananapro.site/api/mcp"
}
}
}Custom connector
- 1Open the client's settings and find the field for a custom connector or a remote MCP server.
- 2Paste the server address shown below and save.
- 3Choose Connect, sign in to your account and press Allow.
https://preview.bananapro.site/api/mcpAPI key
- 1Use this method only for clients that cannot open a browser.
- 2Create a key on the API keys page. Send it in the header shown first, or add it under headers in a JSON configuration as in the second field.
- 3Store the key in the credential settings of the client and never share it.
Authorization: Bearer YOUR_API_KEY{
"mcpServers": {
"nanobanana": {
"url": "https://preview.bananapro.site/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}What the assistant can do
The server exposes six tools. Four only read information and cost nothing; two start a generation and use credits.
| Tool | What it does | Uses credits |
|---|---|---|
| list_models | Lists the image and video models available to your account and the request types each one accepts. | No |
| get_balance | Shows how many credits the account has left. | No |
| generate_image | Starts an image generation or an image edit from a prompt and optional reference images. | Yes |
| generate_video | Starts a video generation from a prompt, images or other reference media. | Yes |
| get_task | Checks a generation and returns the result links once it has finished. | No |
| list_tasks | Lists recent generations, which helps when a task id was lost. | No |
Command line tool
The nanobanana command creates images and videos from a terminal, from scripts and from AI apps that can run commands on your computer.
Requires Node.js 22 or later on macOS or Linux.
Install the CLI
Install the package @nanobanana-pro/cli with npm.
npm install -g @nanobanana-pro/cliSign in
Run the command, then sign in to your account in the browser window and press Allow.
nanobanana auth loginCheck the account and the models
This command shows your credit balance. The command nanobanana models lists the available models.
nanobanana accountCreate
Save a request with the model and the prompt in request.json, then run the command. The option --wait keeps it running until the task is finished.
nanobanana create --input request.json --waitDownload the result
Replace TASK_ID with the task ID returned by the previous command.
nanobanana download TASK_ID --output result.png
See it run
Ask for a picture in one sentence. Your AI app writes the request, creates the image and saves the file.
$ nanobanana create --input request.json --wait
Task TASK_ID submitted; waiting for the result…
{ "status": "completed" }
$ nanobanana download TASK_ID --output result.png
{ "files": ["result.png"] }
Models
The assistant can use the image and video models that your account can use on the website and in the API.
- Ask the assistant to call list_models for the current list of models and the kinds of request each one accepts.
- Each model offers the same options as on the website. A setting that a model does not support is declined with an explanation.
- Reference images and videos must be public https links. Files cannot be uploaded through MCP.
Credits and billing
- Signing in and the free tools (list_models, get_balance, get_task, list_tasks) cost nothing.
- generate_image and generate_video use the same credits as the website and the API, taken from your account balance.
- A task that fails is refunded automatically.
- Your subscription to the AI assistant itself is separate and is billed by that assistant.
Example requests
Once the server is connected, try asking your assistant something like this.
- Which image and video models can I use? Show them as a short list.
- Create a 16:9 product photo of a ceramic mug on a wooden table.
- Turn this landscape photo into a five-second video: https://example.com/photo.jpg
- Check the status of my latest task and send me the result link.
Frequently asked questions
Do I need an API key?
Not for clients that can open a browser. Signing in and pressing Allow is enough. A key is needed only for clients that cannot, as described under API key.
Where do I see or remove a connection?
Open the API keys page. Each connection appears there under the name of its client, and removing it ends that client's access.
What does a generation cost?
The same credits as on the website and in the API. A task that fails is refunded automatically.
Can I use my own images or videos as references?
Yes, as public https links. There is no file upload, so place the file where it can be reached and pass its address.
The connection works but the tools do not appear. What should I do?
Check that the sign-in was completed and that the client lists the server as connected. Then start a new conversation, because some clients load tools only at the start.
Where do I find the results?
The assistant returns the result links in the conversation. Earlier tasks can be listed again with list_tasks.
Prefer to call the API yourself?
The MCP server is built on the public API. The documentation lists every endpoint, parameter and model.