Codex reads MCP servers from ~/.codex/config.toml, and the Codex CLI and desktop app share that file. The simplest setup is the animawake CLI, which writes the server entry, a wake skill, and session hooks for you.
#With the animawake CLI
You need Node.js 20.17 or newer (22.13 or newer on Node 22) and Codex installed.
In your project directory, run:
npx animawake setup --codexWithout
--codex, setup configures every engine it finds: Claude Code, Codex, or both.Your browser opens the portal's CLI sign-in page. Pick the entity. The CLI receives a new entity key and writes:
File Purpose ~/.codex/config.tomlA [mcp_servers.<entity-slug>]block that runs the stdio bridge.~/.codex/skills/<entity-slug>/SKILL.mdA wake skill that loads the entity. AGENTS.mdA block, between animawake:<entity-slug>markers, telling Codex to wake as the entity on the first turn..codex/hooks.jsonSession hooks that capture transcripts for continuity. .animawake.jsonThe entity slug, workspace slug, and key. Owner-only permissions, added to .gitignore.The server block looks like this:
[mcp_servers.<entity-slug>] command = "npx" args = ["-y", "animawake", "mcp", "<entity-slug>"]Launch Codex as the entity:
npx animawake <entity-slug> --codexIf you use Codex more than Claude Code, make it the default with
npx animawake set-default codex.
The launcher starts Codex with --dangerously-bypass-approvals-and-sandbox, so commands run without approval prompts or sandboxing. To keep Codex's approvals, run codex yourself in the project; the MCP tools and the AGENTS.md wake instructions still apply.
#Where the key comes from
The server entry in ~/.codex/config.toml is global, but the bridge looks up the key in .animawake.json, starting in the current directory and walking up. Run Codex inside the project (or a subdirectory) where you ran setup. To use the entity anywhere, set ANIMAWAKE_API_KEY to an ent_ key in your environment; the bridge checks it first.
#Session hooks in Codex
Continuity capture uses Codex hooks. If your ~/.codex/config.toml has hooks = false under [features], the hooks do not run; npx animawake status reports this.
#As a remote MCP server
Recent Codex versions can connect to streamable HTTP servers directly. Check codex mcp --help for the commands your version supports.
With OAuth:
codex mcp add <entity-slug> --url https://mcp.animawake.com/e/<workspace-slug>/<entity-slug>/
codex mcp login <entity-slug>Codex opens the browser and receives the token on a loopback address, which Animawake allows.
With an entity key, add the server to ~/.codex/config.toml and keep the key in an environment variable:
[mcp_servers.<entity-slug>]
url = "https://mcp.animawake.com/e/<workspace-slug>/<entity-slug>/"
bearer_token_env_var = "ANIMAWAKE_API_KEY"export ANIMAWAKE_API_KEY=ent_your_key_here#Check the connection
In Codex, ask:
Call get_startup and tell me who you are.Run /mcp in the Codex CLI to list connected servers and their tools.
#Troubleshooting
no key configured for entity '<slug>': Codex was started outside the project that holds.animawake.json. Start it in the project, setANIMAWAKE_API_KEY, or runnpx animawake addin the new directory.API key for '<slug>' rejected: the key was deleted or expired. Runnpx animawake rotate-key <entity-slug>.- The entity does not wake on the first turn: make sure
AGENTS.mdcontains theanimawake:<entity-slug>block, or invoke the wake skill by name.
For more, see Connection troubleshooting.