{"id":"0b60302e-8cd3-428b-b110-2bd581e435ec","slug":"frannkurt-nano-banana-mcp","kind":"mcp","name":"nano-banana-mcp","summary":"Free AI image generation MCP server — no API key, no billing. Nano Banana via Google Flow with your own Google account. Exact pixel sizes, reference images, $0 per image.","owner":"frannkurt","repoUrl":"https://github.com/frannkurt/nano-banana-mcp","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":6,"match":null,"fewStars":false,"format":"mcp","createdAt":"2026-08-07T16:51:47.000Z","addedAt":"2026-10-21T04:56:53.535Z","logoUrl":"https://avatars.githubusercontent.com/u/243223079?u=a0d94f4dedef6623a8e3ed0b517b91b6cc39826b&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["design-media","cloud-infra","browser-web"],"tags":["ai-images","claude","claude-code","design-tools","generative-ai","google-flow","image-generation","nano-banana"],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-26T02:54:09.639Z","sample":false,"url":"https://conduits.dev/tools/frannkurt-nano-banana-mcp","language":"TypeScript","transports":["stdio"],"install":{"npm":"nano-banana-mcp"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"<p align=\"center\">\n  <img src=\"docs/hero.jpg\" alt=\"A banana on a seamless studio backdrop, generated by this server\" width=\"100%\">\n</p>\n\n<h1 align=\"center\">nano-banana-mcp</h1>\n\n<p align=\"center\">\n  <strong>Free AI image generation for Claude and any MCP client.<br>\n  No API key. No billing account. No per-image cost. Just the Google account you already have.</strong>\n</p>\n\n<p align=\"center\">\n  <img src=\"https://img.shields.io/badge/cost-%240.00-success.svg\" alt=\"Free\">\n  <img src=\"https://img.shields.io/badge/API%20key-not%20required-success.svg\" alt=\"No API key required\">\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/badge/license-Apache--2.0-blue.svg\" alt=\"Apache-2.0\"></a>\n  <img src=\"https://img.shields.io/badge/node-%E2%89%A520-brightgreen.svg\" alt=\"Node 20+\">\n  <a href=\"README.es.md\"><img src=\"https://img.shields.io/badge/docs-espa%C3%B1ol-lightgrey.svg\" alt=\"Español\"></a>\n</p>\n\n<p align=\"center\"><sub>English · <a href=\"README.es.md\">Leer en español</a></sub></p>\n\n---\n\n```\ngenerate_image(prompt: \"an orange fox on a white background\", size: \"1200x630\")\n-> images/an-orange-fox-on-a-white-background.jpg   1200x630   0 credits\n```\n\n> **Every image in this README was generated by this server.** The banner above, the crops below, and the\n> logo renders further down. Nothing was touched up by hand.\n\n---\n\n## Why this one is different\n\nEvery other image MCP server bills you. You register for an API key, attach a credit card, and pay per image —\na few cents each, which quietly becomes real money once a model is iterating on a design and throwing away nine\nattempts out of ten.\n\nThis one doesn't, because it isn't calling a paid API at all. It drives **Nano Banana**, the image model inside\n[Google Flow](https://flow.google.com), through the web app you already have access to. Flow charges\ncredits for video. **Images cost zero.**\n\n|                       | API-based image MCPs           | nano-banana-mcp                     |\n| --------------------- | ------------------------------ | ----------------------------------- |\n| API key               | Required                       | **None**                            |\n| Billing account       | Required                       | **None**                            |\n| Cost per image        | Cents each, and it adds up     | **$0.00**                           |\n| Setup                 | Register, key, billing, secret | Sign into Google in a Chrome window |\n| Exact pixel sizes     | Rarely                         | Yes                                 |\n| Reference images      | Sometimes                      | Yes                                 |\n\nThe trade-off is honest and worth stating: it needs a **real Chrome window that you are signed into**, so it can't\nrun headless or in CI. That's the price of not having a bill.\n\n## What it solves\n\nFlow generates in five fixed aspect ratios: 16:9, 4:3, 1:1, 3:4 and 9:16. Real design work almost never lands on one\nof them — an Open Graph card is 1200×630, a repo banner is 1456×180, an avatar is 400×400.\n\nThis server generates at the closest native ratio and crops to the exact size, using saliency detection so the crop\ndoesn't decapitate your subject. Ask for `1200x630`, get a 1200×630 file.\n\n> **What \"exact size\" does and doesn't mean.** The model is not generating at your dimensions — Flow always returns\n> its own native resolution, around 1 megapixel (1376×768 for 16:9, 1024×1024 for 1:1). The exact size is produced\n> here, locally, by cropping and scaling that result. The file you get really is 1200×630; the pixels in it came from\n> a 1376×768 render.\n>\n> That's a genuine convenience when you're going **down** from native, which covers most web work. Going **up** it\n> will still hand you the file you asked for — request 3000×3000 and you get 3000×3000 — but those extra pixels are\n> interpolated, not generated. There is no more detail in them. The server prints a warning when this happens; if you\n> need real resolution beyond native, upscale deliberately with a tool built for it.\n\n**One generation, three sizes.** Same source image, cropped three ways — note how the crop follows the subject\ninstead of blindly taking the centre:\n\n| `1200x630` — Open Graph | `400x400` — avatar |\n| --- | --- |\n| <img src=\"docs/size-1200x630.jpg\" width=\"100%\"> | <img src=\"docs/size-400x400.jpg\" width=\"100%\"> |\n\n`1456x180` — repo banner\n\n<img src=\"docs/size-1456x180.jpg\" width=\"100%\">\n\n## Reference images\n\nGive it an image and the prompt stops describing what to *create* and starts describing what to *change*. Feed it a\nflat logo and ask for it letterpressed into cotton paper, or cast as a matte signage object:\n\n<img src=\"docs/reference-images.jpg\" width=\"100%\">\n\n<sub>Left: the source vector, handed in as a reference. Centre and right: two generations from it, four variants each,\n0 credits, about a minute per batch.</sub>\n\n```jsonc\ngenerate_image({\n  prompt: \"this logo letterpressed into thick warm off-white cotton paper, raking side light\",\n  reference_images: [\"assets/logo.png\"],\n  count: 4\n})\n\n// iterating on the same reference? don't re-upload it\ngenerate_image({\n  prompt: \"same, but with a deeper impression and visible paper tooth\",\n  reference_library_names: [\"logo.png\"],\n  count: 4\n})\n```\n\nFlow doesn't take a file straight into the composer: it uploads to the project library first, and you pick it from\nthere. Both steps are handled for you, including the confirm click that actually attaches it. Any reference left over\nfrom a previous turn is cleared first — a forgotten one silently changes the image, and the result gets blamed on the\nprompt.\n\n## How it works\n\nFlow has no public API. Its internal generation call is signed with a reCAPTCHA Enterprise token minted by the page's\nown JavaScript, so **it cannot be replayed from outside the browser** — and this project does not try to. That single\nconstraint shapes the whole design.\n\nSo it does what a person would do: type into the composer and press Enter. What's different is how it reads the result.\n\n**It intercepts the page's own network response** instead of watching the library for something new to show up. That\nresponse already carries the media id, the true dimensions and a signed URL, so there's no polling, no guessing which\nthumbnail is yours, and no ambiguity when several generations are in flight. The only fragile part left is typing the\nprompt.\n\n**One request, four responses.** Ask for four variants and Flow doesn't return an array — it sends four separate HTTP\nresponses, staggered by a couple of seconds. Waiting for \"the next response\" quietly drops three of them and looks\nexactly like an account limit. The collector listens to the whole stream and closes on whichever comes first: all\nexpected images, a 20-second silence, or the hard timeout. It never discards what already arrived.\n\n**UI anchors are Material Symbols ligature names** (`crop_16_9`, `image`, `add_2`) and numeric labels (`16:9`, `x4`).\nThose are identifiers, not translatable text, so it behaves the same whether the interface is in English, Spanish or\nJapanese.\n\n**The cost gate closes before sending.** The server reads the cost *Flow itself* computes in its settings panel and\naborts if it exceeds `FLOW_MAX_COST`, which defaults to 0. The refusal happens while refusing is still free. If the\nnumber can't be read, it doesn't send either — it won't guess.\n\n## Requirements\n\n- Node.js 20 or newer\n- Google Chrome\n- A Google account with access to Flow\n\nThat's the whole list. No API key, no cloud project, no billing account, no secret to rotate.\n\n## Install\n\n```bash\ngit clone https://github.com/frannkurt/nano-banana-mcp.git\ncd nano-banana-mcp\nnpm install\nnpm run build\n```\n\n## Setup\n\n### 1. Let the server reach Chrome\n\n**Recommended — your everyday Chrome (version 144 or newer).** No second browser, your own session, extensions and\ntabs:\n\n1. Open `chrome://inspect/#remote-debugging` and tick **\"Allow remote debugging for this browser instance\"**. Below\n   it Chrome should show the server running at `127.0.0.1:9222`.\n2. The first time the server attaches, Chrome asks whether to allow it. Accept. The server keeps that connection for\n   the whole session, so it doesn't ask again on every image.\n\nThe server finds it on its own: Chrome writes the port to `DevToolsActivePort` inside its user-data folder, and the\nserver reads it there. Leave `FLOW_CDP_URL` unset for this.\n\n**Alternative — a separate Chrome with its own profile.** Chrome won't open `--remote-debugging-port` on your\neveryday profile, which is why this needs a profile of its own (it will look like a fresh Chrome, without your\nextensions). If nothing is found through the option above, the server falls back to port 9222 on its own. The easiest\nway is the bundled launcher (persistent, dedicated profile so you sign in only once):\n\n```bash\nnpm run chrome\n```\n\nIt opens `flow.google.com` in a dedicated profile (`<userData>/nano-banana-flow-profile`) with the debug port on,\nwithout touching your everyday Chrome. Sign in once; the session persists for next time.\n\nOr do it by hand, with a profile separate from your everyday one.\n\n**Windows**\n\n```bash\n\"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\" --remote-debugging-port=9222 --user-data-dir=\"%USERPROFILE%\\.nano-banana-mcp\\chrome\" https://flow.google.com\n```\n\n**macOS**\n\n```bash\n\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" --remote-debugging-port=9222 --user-data-dir=\"$HOME/.nano-banana-mcp/chrome\" https://flow.google.com\n```\n\n**Linux**\n\n```bash\ngoogle-chrome --remote-debugging-port=9222 --user-data-dir=\"$HOME/.nano-banana-mcp/chrome\" https://flow.google.com\n```\n\n### 2. Sign in and open a project\n\nIn that Chrome, sign in with your Google account and open a Flow project. The URL must end up at\n`flow.google.com/project/<id>`.\n\nWithout an open project there is no composer, and without a composer nothing can be generated. The server remembers\nthe last project it worked in (`~/.nano-banana-mcp/state.json`): if Flow is open on its home page, or not open at\nall, it takes a single tab back to that project.\n\n### 3. Register the server\n\nIn Claude Code:\n\n```bash\nclaude mcp add nano-banana --env FLOW_OUTPUT_DIR=./images -- node /path/to/nano-banana-mcp/dist/index.js\n```\n\nAdd `--env FLOW_CDP_URL=http://127.0.0.1:9222` only if you want to force a specific Chrome instead of the automatic\nchoice.\n\nOr by hand, in your MCP client's config:\n\n```json\n{\n  \"mcpServers\": {\n    \"nano-banana\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/nano-banana-mcp/dist/index.js\"],\n      \"env\": {\n        \"FLOW_OUTPUT_DIR\": \"./images\",\n        \"FLOW_MAX_COST\": \"0\"\n      }\n    }\n  }\n}\n```\n\n### 4. Check it\n\n```bash\nnode scripts/doctor.mjs\n```\n\nThat checks the browser, session, project, composer and balance in order, and stops at the first thing that's\nwrong with instructions for fixing it. Once it's clean, try a real generation:\n\n```bash\nnode scripts/smoke.mjs \"an orange fox on a white background\" 1200x630\n```\n\n## Tools\n\n### `flow_status`\n\nConnection state: session, account, open project, credit balance. Start here when something fails.\n\n### `generate_image`\n\n| Parameter                 | Type                            | Default            | What it does                                                  |\n| ------------------------- | ------------------------------- | ------------------ | ------------------------------------------------------------- |\n| `prompt`                  | string                          | —                  | Image description, in any language                            |\n| `size`                    | string                          | native             | Exact output size, `\"WIDTHxHEIGHT\"`, e.g. `\"1200x630\"`         |\n| `aspect`                  | `16:9` `4:3` `1:1` `3:4` `9:16` | derived from `size` | Native ratio to generate at                                   |\n| `count`                   | 1–4                             | 1                  | How many variants                                              |\n| `reference_images`        | string[]                        | —                  | Local paths to use as references; uploaded and attached for you |\n| `reference_library_names` | string[]                        | —                  | Files already in the project library, attached without re-uploading |\n| `out_dir`                 | string                          | `FLOW_OUTPUT_DIR`  | Destination folder                                             |\n| `basename`                | string                          | derived from prompt | Base filename                                                  |\n| `format`                  | `jpg` `png` `webp`              | `jpg`              | Output format                                                  |\n| `fit`                     | `cover` `contain`               | `cover`            | `cover` crops to fill, `contain` pads the edges                |\n| `background`              | CSS color                       | `#ffffff`          | Padding color when `fit` is `contain`                          |\n| `upscale`                 | `2k` `4k`                       | —                  | Ask Flow's own upscaler for real detail beyond native (see below) |\n\nReturns the saved paths, each media id, and a thumbnail of every result — so the model can see what came out and\ndecide whether it's worth another try.\n\n### `generate_batch`\n\nGenerates several **different** prompts in one call, **queued in the same Flow tab**: up to 8 jobs, each with its\nown optional `size`, `aspect`, `basename`, `reference_images` and `reference_library_names`. Shared `out_dir`,\n`format`, `fit`, `background` and `upscale`.\n\nFlow accepts a new prompt while the previous ones are still generating, so the tool sends them one after another\nwithout waiting, and collects everything at the end. No extra tabs are opened. Three prompts land in about 40 seconds.\n\nOne failed job doesn't sink the rest: you get the saved files that worked and a per-job error for the ones that didn't.\n\n### `list_library`\n\nLists the images in the project library, newest first: uploads (with the exact filename `reference_library_names`\nexpects) and generated images (with their prompt and media id). Read via the project API — no UI is touched. Filter\nwith `only`: `uploaded`, `generated` or `all`.\n\n### `download_image`\n\nFetches an existing image by media id, with optional cropping (`size`, `fit`, `background`). Useful for recovering\nsomething generated earlier, or pulling several sizes out of the same original. Accepts `upscale` too.\n\n### `upscale_image`\n\nUpscales an image that already exists in the open project, by media id, with Flow's own upscaler, and saves it\n(`out_file`, optional `size`/`fit`/`background`). `target` is `2k` (default) or `4k`.\n\n### `generate_video`\n\nGenerates a video with Veo (text to video, `16:9` or `9:16`) and saves it as `.mp4`. **Video costs credits**, so it\nonly runs when `FLOW_MAX_COST` is above the cost Flow quotes; otherwise it refuses before sending anything. The\nresult is downloaded at its original 720p (Flow's 1080p and 4K are upscales and are never chosen). Videos take a few\nminutes.\n\n## Upscaling\n\nNano Banana delivers 1024x1024 in square and 1376x768 in landscape, and that is where real detail ends: a larger\n`size` on its own only interpolates. Flow ships its own upscaler that reconstructs the image at 2K or 4K, and it is\nthe only thing that adds detail. Pass `upscale: \"2k\"` to `generate_image` or `download_image`, or call\n`upscale_image` on a media id.\n\n| Native     | 2K        |\n| ---------- | --------- |\n| 1376x768   | 2752x1536 |\n| 1200x896   | 2400x1792 |\n| 1024x1024  | 2048x2048 |\n\n2K is free and takes about 10 s per image. 4K is offered only on paid plans; on a free account the menu entry is\ndisabled and the tool says so instead of trying. Like generation, this goes through the interface (the upscale RPC\nis signed with a single-use reCAPTCHA token): the tool right-clicks the tile, picks Download → 2K and takes the\nresult from the download the page itself starts. That means the image must belong to the project open in the Flow\ntab, and upscales run one at a time.\n\n## Configuration\n\n| Variable                   | Default                  | What it does                                     |\n| -------------------------- | ------------------------ | ------------------------------------------------ |\n| `FLOW_CDP_URL`             | automatic                | Force a Chrome debugging endpoint (`http://…` or `ws://…`). Unset: your everyday Chrome if remote debugging is allowed, else `http://127.0.0.1:9222` |\n| `FLOW_CHROME_USER_DATA`    | Chrome's default folder  | Where to look for `DevToolsActivePort`, if your Chrome uses a non-default user-data folder |\n| `FLOW_OUTPUT_DIR`          | `~/nano-banana-images`   | Where images are saved                           |\n| `FLOW_MAX_COST`            | `0`                      | Credit ceiling per generation                    |\n| `FLOW_GENERATE_TIMEOUT_MS` | `180000`                 | How long to wait for Flow to answer              |\n| `FLOW_LANG`                | system locale, else `en` | Language of this server's messages: `en` or `es` |\n\n## Languages\n\nTwo different languages meet in this project, and it's worth not confusing them.\n\n**Flow's interface language** is whatever your Google account is set to, and this server never depends on it. It\nanchors on Material Symbols ligature names (`crop_16_9`, `add_2`, `image`) and numeric labels (`16:9`, `x4`) — those\nare identifiers, not copy, so they read the same in every locale. It never matches translatable text like \"Add to\nprompt\". Tested against a Spanish interface; the anchors are language-independent by construction.\n\nThe one place that used to depend on it was reading the cost. That's now taken from the panel's structure — the leaf\n`<a>` element holding the number — instead of matching the word next to it. It matters because the cost gate refuses\nto send when it can't read the number, so a German user seeing \"0 Punkte\" would have been blocked from generating\nanything at all. Safe, but useless.\n\n**This server's own messages** — errors, warnings, status, and the MCP tool descriptions your model reads — come in\nEnglish and Spanish. It picks from `FLOW_LANG`, falling back to your system locale, defaulting to English.\n\n```bash\nFLOW_LANG=es node dist/index.js\n```\n\nCode comments stay in Spanish. That's a choice about how this codebase is written, not something a user ever sees.\n\n## Generating several at once: one tab, queued\n\nThe server works in **a single Flow tab** and never opens extra ones. It doesn't need to: the composer frees up as\nsoon as a prompt is sent, and Flow keeps generating it while you send the next one.\n\nWhich image belongs to which prompt: Flow draws each submission **above** the previous one, and the images take their\nsubmission's place even if they finish in a different order. So, in screen order, the last prompt's images come\nfirst, and the queue hands them out from the end. Reference images are uploaded **before** the queue starts, because\nan uploaded image shows up in the grid just like a generated one.\n\nThe `generate_batch` tool does this for you. For scripts, the same queue is available as a library API:\n\n```js\nimport { generateQueue } from \"nano-banana-mcp/dist/generate.js\";\n\nconst { results } = await generateQueue([\n  { prompt: \"a red apple on a white table\", aspect: \"1:1\", count: 1 },\n  { prompt: \"a blue vintage car on an empty street\", aspect: \"16:9\", count: 2 },\n  { prompt: \"macro of these veneer sheets\", aspect: \"4:3\", count: 1, referenceImages: [\"ref.jpg\"] },\n]);\n// results[i].images → that job's images; results[i].error → why it gave none\n```\n\nThe UI is driven in the foreground (Chrome freezes `requestAnimationFrame` in background tabs, and React stops\nresponding there), so the Flow tab is brought to the front while prompts are being sent.\n\n## On cost\n\nImages in Flow cost **0 credits**. Video costs, and it costs a lot.\n\nThe gate described above is what keeps that true by accident rather than by trust: the server reads Flow's own quoted\ncost and refuses to send anything above the ceiling.\n\n## Roadmap\n\n**Video is in (`generate_video`, Veo), scenes are not yet.** Video is where the cost gate stops being a formality: it\nonly runs with an explicit, non-zero `FLOW_MAX_COST` above Flow's quoted cost, and it downloads the original 720p\n(never the paid upscales). Nothing that spends credits will ever run because a default let it.\n\n## Privacy and credentials\n\n- **It never handles a credential.** It attaches to a session you opened yourself.\n- The balance is read with a token that is fetched and used **inside the tab**. That token never crosses into this\n  process, is never written to disk, and is never logged.\n- Nothing is sent anywhere except Google Flow.\n\n## Troubleshooting\n\nRun `node scripts/doctor.mjs` first — it checks the whole chain in order and stops at the first thing that's wrong.\nThe messages below are the English ones; with `FLOW_LANG=es` you'll see the Spanish equivalents.\n\n> **On the new Flow interface (flow.google.com).** It's supported: images, upscaling, references, the queue and\n> video were verified against it. On it, the credit balance can't be read anymore (the session endpoint is gone), so\n> `flow_status` shows it as unknown; the signed-in account is read from the page instead.\n\n**\"Couldn't connect to Chrome at …\"** — with your everyday Chrome: open `chrome://inspect/#remote-debugging`, check\nthat \"Allow remote debugging for this browser instance\" is ticked and that it shows the server running, and accept the\nprompt Chrome shows when the server attaches. With a separate Chrome: it isn't running with\n`--remote-debugging-port=9222`, or you launched it without its own `--user-data-dir` and it attached to an existing\ninstance. Close every window of that profile and relaunch with the command above.\n\n**\"No Flow (flow.google.com) tab is open in that Chrome\"** — open Flow in that Chrome window.\n\n**\"Couldn't find the prompt composer on the page\"** — you're on the project list, not inside a project. The URL must\ncontain `/project/`.\n\n**\"I couldn't read what this generation would cost, so I'm not sending it\"** — Flow's interface changed. If the text\nthe error quotes mentions \"Confirm before generating\", see the note on the new interface above. Otherwise the\nerror includes the text it did read; open an issue pasting it and it gets fixed in one place. Either way this is a\n*refusal*, not a crash: nothing was sent and nothing was spent.\n\n**\"Couldn't find X in the library picker\"** — the reference file isn't in this project's library, or the name doesn't\nmatch. Check the exact filename as it was uploaded.\n\n**\"Selected X in the library but it didn't attach to the composer\"** — the picker's confirm button moved. Open an\nissue with the **Flow's interface changed** template.\n\n**It generated but the crop is wrong** — try `fit: \"contain\"`, or pass an explicit `aspect` closer to your final size\ninstead of letting it be derived.\n\n## Limitations\n\n- Images only. Video and scenes are in development, not available yet.\n- Needs a visible, signed-in Chrome window. It does not work headless or in CI.\n- It depends on Flow's interface to type the prompt. Google can change it; when they do, the submit step breaks and\n  needs adjusting.\n- Not a Google product. Not endorsed by or affiliated with Google.\n\n## Contributing\n\nYes, please — see [CONTRIBUTING.md](CONTRIBUTING.md). The most valuable contribution is a fix for a Flow UI change,\nand that guide explains how to diagnose one properly instead of guessing at selectors.\n\nAlso welcome: setup reports from macOS and Linux (this was built on Windows), and testing against interfaces in\nlanguages other than Spanish and English.\n\nBy participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md). Security issues go\n[here](SECURITY.md), privately.\n\n## License\n\nApache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).\n\nNot a Google product. Not endorsed by or affiliated with Google.\n"}