Connect imem to Codex CLI
2 steps · about 45 seconds
Codex CLI reads MCP servers from ~/.codex/config.toml. Authorization is OAuth in the browser — no API key needed.
Server URL
https://mcp.imem.aiAuthentication uses OAuth in the browser with PKCE and dynamic client registration. No API key is needed; tokens are scoped to one vault and can be revoked from settings.
Setup steps
- 1
Edit config.toml
Open ~/.codex/config.toml in your editor and append:
~/.codex/config.toml[mcp_servers.imem] url = "https://mcp.imem.ai" - 2
Run codex and authorize
Run codex. On the first imem tool call you will be sent to the OAuth page in your browser. Approve it — no API key to paste.
Verify the connection
Paste the test prompt into a Codex session. Codex should save and read back a harmless test memory, then tell you imem is ready.
Test prompt
Run the imem setup check now. Use the "setup_imem" tool if it is available. It should save and read a harmless test memory, then tell me whether imem is ready.
Troubleshooting
- Server not picked up — check the TOML table name is exactly [mcp_servers.imem] and restart codex.
- OAuth page never opens — trigger any imem tool call from a prompt; authorization happens on first use, not at startup.
Ready to remember everything?
Create a free vault, connect Codex, and your AI keeps durable memory across every session.