Docs / Connect / Codex CLI
Codex CLI keeps its MCP servers in a single TOML file, so connecting ModelBrain means adding one small table to it and nothing else.
Codex is the one assistant here whose config is TOML rather than JSON, which makes a careless paste the most likely way to break it. The safe move is to add one table and leave everything else in the file exactly as it was.
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.
/Applications/ModelBrain.app/Contents/MacOS/mcp_server
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.
/home/you/.local/lib/modelbrain/mcp_server, with your own home folder. The install script puts ModelBrain in ~/.local/lib/modelbrain.
~/.codex/config.toml, or config.toml inside the folder named by your CODEX_HOME variable if you set one. Create it if it does not exist.[mcp_servers.modelbrain], edit it instead of adding a second one, because TOML refuses duplicate tables.[mcp_servers.modelbrain]
command = "/Applications/ModelBrain.app/Contents/MacOS/mcp_server"Available in 0.5.0. Setup for Codex CLI is in ModelBrain 0.5.0 and later. It is tested on sample files only, and the config location comes from OpenAI's docs. We have not yet tried it on a real Codex CLI install. If anything differs on your machine, use the manual steps above and tell us through the Support page.
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.
Not yet. ModelBrain's setup code can add and remove this table safely and keeps your comments and other settings untouched, but it is not in a released build, so this page uses the manual route.
It is the program ModelBrain installs inside its app bundle. If you installed ModelBrain somewhere other than Applications, use the path to mcp_server inside that copy of the app.
Delete the [mcp_servers.modelbrain] table from config.toml. Your memories are not stored in that file, so nothing is lost.
We have tested this configuration against sample files and the ModelBrain setup code, but not yet by hand on a real install of Codex CLI. If ModelBrain does not appear in Codex CLI after you follow these steps, tell us through the Support page and we will fix this guide.
A 10-minute walkthrough: add a folder, ask something that needs two notes, see the citation.
Quickstart →