Docs / Connect / VS Code

Connect ModelBrain to VS Code

VS Code keeps MCP servers in an mcp.json file, and connecting ModelBrain means adding one entry to it.

VS Code uses a different top-level key from nearly every other client. Its file says servers where the others say mcpServers, so an entry pasted from another guide can sit in the file and do nothing.

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 your user MCP file. In VS Code, open the Command Palette and run MCP: Open User Configuration. That opens the mcp.json for your profile, so ModelBrain is available in every workspace. For one project only, use .vscode/mcp.json in that project instead.
  3. Add ModelBrain under servers. If the file is empty, this is the whole content. If it already has a servers object, add only the modelbrain entry inside it, with a comma after the entry before it.
    {
      "servers": {
        "modelbrain": {
          "type": "stdio",
          "command": "/Applications/ModelBrain.app/Contents/MacOS/mcp_server"
        }
      }
    }
  4. Save, then start the server. Run MCP: List Servers from the Command Palette, choose modelbrain, and start it. If VS Code asks whether you trust the server, read the prompt before accepting.
  5. Check it is connected. In Copilot Chat, ask it to remember something using ModelBrain, expand the tool call to confirm it came from modelbrain, then recall it in a new chat.
Questions

Why does the file say servers and not mcpServers?

VS Code's own format uses servers. Other clients use mcpServers. If you copy an entry from another guide, change the top-level key.

Does VS Code ask before it runs ModelBrain's tools?

VS Code asks you to trust a server the first time, and you can reset those trust decisions with the MCP: Reset Trust command. Read the prompt before accepting it.

How do I undo it?

Remove the modelbrain entry, or stop the server from MCP: List Servers. Your memories are not stored in that file.

Has this been tested?

We have tested this configuration against sample files and the ModelBrain setup code, but not yet by hand on a real install of VS Code. If ModelBrain does not appear in VS Code after you follow these steps, 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 →