How to Connect Nano Banana to Grok Bot (Gemini Image Generation via MCP)

Grok Bot is great at running things, but it can’t make images on its own. Google’s Nano Banana models can. This guide shows how to connect the two through an MCP server, so Grok Bot can generate and edit images whenever you ask in chat.
What you’re connecting
- Nano Banana is the nickname for Google’s Gemini image models. They generate images from text and edit images you give them. The current versions are Nano Banana 2 (
gemini-3.1-flash-image), Nano Banana 2.1 (gemini-nano-banana-2.1) and Nano Banana Pro (gemini-3-pro-image). - Grok Bot is xAI’s always-on AI agent, available as an app for macOS and iOS. It can take on new abilities through MCP servers, which are small connectors that give the bot extra tools.
To connect them, you give Grok Bot an MCP server that calls the Nano Banana API.
What you need
- Grok Bot running. Mine runs on a Mac mini.
- A Google Gemini API key from Google AI Studio. Image generation is billed per image, so check Google’s pricing first.
- Node.js on the Mac, if you use a local (stdio) server. Install it with
brew install node.
Step 1: Get a Gemini API key
- Sign in at Google AI Studio and choose Get API key, then Create API key.
- Keep the key private. Never paste it into an ordinary chat message.
Step 2: Choose a Nano Banana MCP server
Google doesn’t publish an official one, but there are several community servers. They all read your key from a GEMINI_API_KEY setting. Two examples:
nano-banana-mcp(ConechoAI), which runs withnpx nano-banana-mcp@seungmanchoi/nano-banana-mcp, which runs withnpx -y @seungmanchoi/nano-banana-mcp
These are third-party projects. Before you give one your key, read its README and check that it’s still maintained.
Step 3: Add the server to Grok Bot
Guides disagree on how Grok Bot takes new servers, so use whichever your version of the app shows.
Option A: the connector form. Go to Connect apps → Add a custom connector. Give it a name such as Nano Banana, and enter the server’s URL for a remote server or its npx command for a local one. Add your key as a header or environment variable named GEMINI_API_KEY.
Option B: ask the bot in chat. For example:
Add an MCP server called Nano Banana that runs
npx -y nano-banana-mcp. It needs aGEMINI_API_KEY.
When the bot asks for the key, enter it in its secure secret prompt, which hides the key. Don’t type the key into the conversation itself.
One thing to watch: some guides say Grok Bot does its thinking in the cloud. If so, it can’t reach a server that only listens on your Mac’s localhost. Giving it an npx command, or using a remote server URL, avoids that problem.
Step 4: Test it
Ask Grok Bot something like:
Use Nano Banana to make a 16:9 image of a network rack in a home office, in a clean illustration style.
The bot should call the Nano Banana tool and give you back an image. To edit one, attach an image and ask for a change, such as “make the background dark blue.”
Troubleshooting
- The tool doesn’t show up: ask the bot to list its MCP servers, then remove the Nano Banana one and add it again.
- 401 or “API key invalid”: the key is wrong or missing. Enter it again through the secure secret prompt.
- “Model not found”: the server may be using an old model ID such as
gemini-2.5-flash-image. Check its settings, or update the package to a version that uses a current Nano Banana model. - It can’t connect: the server is probably only reachable on localhost (see the end of Step 3).