AIVM Brain connects to OpenAI Codex as an MCP server. Codex gains governed recall over everything your brain holds: decisions, docs, conventions, past fixes. Add one server block to Codex's MCP configuration and every session can query and capture knowledge, with permissions enforced and every access recorded.
Wire Codex to your brain
Codex talks to the brain over MCP, the same protocol it uses for any external tool. Generate a key in the dashboard, then add the server to Codex's MCP configuration (the Codex CLI reads it from ~/.codex/config.toml as of mid-2026; see OpenAI's docs for your version).
Generate your key. Sign up free at brain.aivm.io, open Connect, pick Codex. The dashboard mints your agent key and shows the exact server config.
Add the MCP server. These are the values, shown here as the standard JSON shape. In config.toml the same three fields (command, args, env) go under an mcp_servers entry:
{ "mcpServers": { "aivm-brain": { "command": "npx", "args": ["-y", "@aivm/brain", "serve"], "env": { "AIVM_BRAIN_URL": "https://brain.aivm.io", "AIVM_AGENT_KEY": "ak_your_key" } } } }Test recall. Ask Codex to store a fact in the brain, start a fresh session, and ask for it back. If it answers cold, it works.
AGENTS.md tells Codex how. A brain tells it what you know.
AGENTS.md is the right place for instructions: how to run tests, what style to follow, where things live. But it is written by hand and frozen until someone edits it. The knowledge that actually compounds on a project is different: why the retry logic looks weird, which API the team decided to deprecate, what the customer actually asked for. That is what the brain holds, and Codex can pull exactly the piece it needs mid-task instead of you pasting context into every prompt.
Because it is a governed store rather than a scratch file, that knowledge survives the machine, the repo, and the person. A new engineer's Codex inherits the project's memory on day one, minus whatever their role is not cleared to see.
Cloud runs and CI need memory most
Codex increasingly runs where you are not: delegated tasks, cloud sandboxes, CI jobs. Those runs start from nothing unless their context is provisioned. A brain over MCP gives a headless Codex run the same recall your interactive session has, and the audit ledger shows you afterwards exactly what it read to do the job. When an autonomous agent touches company knowledge, that record is the difference between trust and hope.