Setup

Gemini CLI

Add it to Gemini CLI.

Gemini CLI talks to B.R.A.I.N. through a small local program called an MCP server. You install the client once, paste a short block into Gemini's settings file, and restart Gemini CLI. You never put your key in the chat.

Before you start

Install the B.R.A.I.N. client first, so the brain-mcp command exists, and so your key is saved privately. You also need Gemini CLI itself already installed.

In a terminal, brain-mcp --help should print a short help message. If it does not, finish the Mac or Windows guide first, including the PATH step.

1. Open Gemini's settings file

Open ~/.gemini/settings.json in a text editor. That file applies to every Gemini CLI session for you. If you only want B.R.A.I.N. in one project, use .gemini/settings.json in that project folder instead. Create the file if it is not there yet.

Mac and Linux. Paste in Terminal to open it
nano ~/.gemini/settings.json

2. Paste this block and save

Add an mcpServers object to the file. If the file already has other settings, keep them, and add this object next to them. Keep the commas valid in JSON. Save the file.

Paste into settings.json
{
  "mcpServers": {
    "brain": { "command": "brain-mcp" }
  }
}

If Gemini cannot find brain-mcp, use the Python form instead. On a Mac, set "command" to python3 and "args" to ["/Users/YOU/.local/bin/brain-mcp"], with your home folder in place of YOU. On Windows, use python and ["C:\\Users\\YOU\\AppData\\Local\\brain-hosted\\brain-mcp.py"].

3. Restart Gemini CLI and confirm the server

Quit Gemini CLI and start it again. Then, in Gemini, run:

Paste into Gemini CLI
/mcp list

You should see brain marked as connected. If it is disconnected, try /mcp reload, then use the fixes below.

4. Check that it works

This is the quick test. Use any harmless fact you will recognize, or use this one.

This chat

Ask: Remember that the staging deploy runs on Fridays. Let it save that to B.R.A.I.N.

A brand new chat

Open a new chat, with no earlier messages. Ask: When does the staging deploy run? It should say Fridays.

If the new chat does not know, restart the app and use the fixes below. Do not paste your key into the chat.

If something goes wrong

/mcp list shows disconnected

Confirm brain-mcp --help works in a regular terminal, not only inside Gemini. Restart Gemini CLI, then run /mcp reload. If the command is not on PATH, switch to the Python form above.

It cannot connect

Run brain selftest in a terminal. If that fails, your key may be missing or revoked. Get a new key from the dashboard and run the installer again. Do not paste the key into Gemini.

The new session does not remember

In the first session, confirm the fact was actually saved. Try asking it to "save this to B.R.A.I.N." then start a fresh Gemini session and ask again.

Other ways to install

All paths · AI bots, including Grok Bot · Mac · Windows · Claude Code · Cursor · Claude Desktop · Gemini CLI · Direct API · Developers

Keep your key private

Never paste an API key into a chat, a ticket, or a note. Each bot has its own key, and you can pause or revoke it in the dashboard. Questions? Contact us.