Install
July 29, 2026 ยท View on GitHub
Recommended Setup
Install the XMemo CLI and authenticate:
npm install --global @xmemo/client
xmemo login
Preview the Codex configuration before writing it:
xmemo mcp add codex
Apply the configuration and run the MCP-depth smoke test:
xmemo mcp add codex --write
xmemo smoke --client codex
The write operation preserves unrelated Codex configuration, generates a stable local agent instance ID when needed, and keeps token values outside project files.
To avoid a global npm installation:
npx --yes --package @xmemo/client xmemo mcp add codex
npx --yes --package @xmemo/client xmemo mcp add codex --write
npx --yes --package @xmemo/client xmemo smoke --client codex
Manual Codex Configuration
Add the following to ~/.codex/config.toml:
[mcp_servers.XMemo]
url = "https://xmemo.dev/mcp"
bearer_token_env_var = "XMEMO_KEY"
http_headers = { "X-Memory-OS-Agent-ID" = "codex" }
env_http_headers = { "X-Memory-OS-Agent-Instance-ID" = "XMEMO_AGENT_INSTANCE_ID" }
Set local environment variables:
[Environment]::SetEnvironmentVariable('XMEMO_KEY', '<your-xmemo-token>', 'User')
[Environment]::SetEnvironmentVariable('XMEMO_AGENT_INSTANCE_ID', 'xmemo-codex-<uuid>', 'User')
Restart Codex after changing user environment variables.
Smoke Test
Run:
xmemo smoke --client codex
pwsh -File scripts/xmemo-codex-doctor.ps1
Then restart Codex and ask:
Use XMemo to recall context for this repository.
Expected result: Codex calls XMemo MCP tools, returns scoped context or a clear empty state, and does not expose credentials.