Docs / Connect / Antigravity

Connect ModelBrain to Antigravity

Antigravity reads its MCP servers from one JSON file in your .gemini folder, and connecting ModelBrain means putting one entry in it.

After its first run the file exists but is completely empty, and an empty file is not valid JSON. Pasting a fragment into it breaks it, so the first thing to do is look at what yours holds.

Where the program lives

This client needs the full path to ModelBrain's mcp_server program. The commands and snippets on this page show the macOS path; on Windows or Linux, put the path for your system in the same place. Write the full path rather than a variable such as %LOCALAPPDATA% or ~, because a client may not expand it.

macOS

/Applications/ModelBrain.app/Contents/MacOS/mcp_server

Windows

C:\Users\you\AppData\Local\Programs\ModelBrain\mcp_server.exe (that is %LOCALAPPDATA%\Programs\ModelBrain\mcp_server.exe, with your own user name). Inside JSON, TOML or a quoted YAML string, double each backslash.

Linux

/home/you/.local/lib/modelbrain/mcp_server, with your own home folder. The install script puts ModelBrain in ~/.local/lib/modelbrain.

Steps
  1. Install ModelBrain if you haven't yet (macOS, Windows or Linux).
  2. Open Antigravity once and sign in, then quit it completely (Cmd+Q on a Mac). Antigravity creates its config folder on first run, and it can overwrite the file if it is open while you edit.
  3. Look at the file. In a terminal run cat ~/.gemini/config/mcp_config.json. If it prints nothing, the file is empty. If it prints JSON, you already have settings to keep.
  4. Put ModelBrain in the file. For an empty file, the whole content is this. If your file already has an mcpServers object, add only the modelbrain entry inside it, with a comma after the entry before it.
    {
      "mcpServers": {
        "modelbrain": {
          "command": "/Applications/ModelBrain.app/Contents/MacOS/mcp_server"
        }
      }
    }
  5. Check the file is valid JSON. Run python3 -m json.tool ~/.gemini/config/mcp_config.json. It prints the file back if it is valid and an error with a line number if it is not.
  6. Open Antigravity and check. In the agent panel, open the ... menu, choose MCP Servers, then Manage MCP Servers. ModelBrain should be listed. Then ask the agent to remember something and recall it in a new chat.
Or use the setup wizard

Available in 0.5.0. Setup for Antigravity is in ModelBrain 0.5.0 and later. Checked by hand on the released 0.5.0 macOS build: the wizard wrote a valid file, Antigravity loaded ModelBrain, and remember, recall, expand and forget ran without errors. The Windows build has not been tried. If anything differs on your machine, use the manual steps above and tell us through the Support page.

  1. Open Setup guide from the ModelBrain menu bar or tray icon.
  2. Find the Antigravity card and click Set up Antigravity. The card appears only when Antigravity is installed (its app or its ~/.gemini/antigravity folder is found). The wizard never creates a client's folders for you.
  3. Let it write the entry. It adds modelbrain to ~/.gemini/config/mcp_config.json, keeps your other servers, and saves a one-time copy of the original file next to it with the suffix .bak-original. If the file cannot be read as valid, the wizard stops and leaves it alone.
  4. Quit and reopen Antigravity, then check that ModelBrain appears under its MCP servers.

Running the wizard twice is safe: it recognises its own entry and does nothing. The uninstaller removes only the entry that points at ModelBrain.app.

Questions

Does it matter if Antigravity is open while I edit?

Yes. Quit it completely first (Cmd+Q on a Mac), edit the file, then open it again, so it reads the new file and cannot overwrite your change.

Can I connect one project only?

Antigravity also reads a .agents/mcp_config.json file in a project folder. The global file in your home folder is the one this guide uses, and it applies everywhere.

Will Antigravity ask before using ModelBrain's tools?

By default it asks for approval each time a tool from a server runs. Antigravity has allow rules that skip that, but we suggest keeping the prompts for a tool that can change what your assistants remember.

How do I undo it?

Remove the modelbrain entry from the file, or restore a backup copy. Your memories are not stored in that file.

Has this been tested?

We tested this by hand on a Mac on 2026-10-19 with ModelBrain installed in Applications: ModelBrain loaded from this file and worked in Antigravity, and a session from Antigravity ran remember, recall, expand and forget with no errors. Other setups, such as Windows or Linux, have not been tested. If your result differs, tell us through the Support page and we will fix this guide.

Not installed yet?

Start with the install guide.

Install ModelBrain →
Then

A 10-minute walkthrough: add a folder, ask something that needs two notes, see the citation.

Quickstart →