Codex
Setting up, authenticating, and running MCP servers in Codex with Ivar.
Codex connects to MCP servers declared in ivar.json through the [mcp_servers.<name>] tables of .codex/config.toml at the hall root. Codex runs its own OAuth login for every server.
Configuration & naming
ivar transforms canonical server names from ivar.json (figma, linear) into hall-qualified identifiers (<hall>-<server>) in .codex/config.toml.
- Provider config path:
.codex/config.toml(hall root) - Canonical vs. qualified names: Declared as
figmaandlinearinivar.json; mapped toacme-figmaandacme-linearin.codex/config.toml(for a hall namedacme). - Configuration schema: A remote server is a
urlalone; Codex infers the streamable-HTTP transport. A local server iscommand,argsand anenvtable. There is notypekey. - Ownership:
ivarowns only the tables it marks with a# managed by ivar (hall: <hall>)comment. Your own servers and keys survive every sync. A server of yours under a nameivarwould write is refused, never overwritten.
Generated .codex/config.toml
# managed by ivar (hall: acme)
[mcp_servers.acme-linear]
url = "https://mcp.linear.app/mcp"
# managed by ivar (hall: acme)
[mcp_servers.acme-figma]
url = "https://mcp.figma.com/mcp"Trust the hall first
Codex loads a project's .codex/config.toml only when it trusts the project, so none of these servers load until you run codex in the hall once and trust the folder. See the Codex provider.
Authentication
You: Log Figma and Linear in for Codex.
Bash(ivar mcp auth figma --provider codex)
Bash(ivar mcp auth linear --provider codex)
Agent: Codex runs the login for both. Approve each one in the browser, then I'll check them.
Bash(ivar mcp status --provider codex --live)
ivar mcp auth <server> --provider codex runs codex mcp login <hall>-<server>, and Codex runs the OAuth handshake itself, with dynamic client registration. ivar never runs its own login flow for Codex, whichever server it is:
Run it by hand
# Through `ivar` (canonical name)
ivar mcp auth linear --provider codex
# Direct Codex command (hall-qualified name)
codex mcp login acme-linearCodex keeps the tokens in its own store, the OS keyring or $CODEX_HOME/.credentials.json, in a layout ivar does not write.
Authenticate all providers
To authenticate all configured providers for a server at once:
Run it by hand
ivar mcp auth linear --all-providersStatus inspection
ivar mcp status cannot read Codex's tokens from a file. With --live, it asks Codex through codex mcp list --json, which reports an auth_status per server:
Run it by hand
ivar mcp status linear --provider codex --liveOAuth ownership & credentials
| Aspect | Remote servers |
|---|---|
| OAuth ownership | Codex (codex mcp login) |
| Preregistration by Ivar | None |
| Credential storage | Codex's own store (OS keyring or $CODEX_HOME/.credentials.json) |
| Status probe | codex mcp list --json (ivar mcp status --live) |