Codex
AlwaysOn Memory connects to Codex (Coding agent (CLI)) over Streamable HTTP MCP using a connection key in ~/.codex/config.toml. Once connected, Codex can read, search, write, and hand off project memory across fresh sessions and other connected tools.
How do I connect Codex to AlwaysOn Memory?#
Connect Codex over Streamable HTTP MCP with your workspace URL (https://always-on.cloud/t/YOUR-WORKSPACE/mcp) and a workspace-scoped awm_ connection key in ~/.codex/config.toml. Create the key under Setup or Connections, paste the config below, and reload Codex to load all 16 memory tools.
- Transport
- Streamable HTTP MCP (2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05)
- Authentication
- Workspace-scoped Bearer connection key (
awm_...) in theAuthorizationheader. Cursor and VS Code also support one-click browser OAuth 2.1. Config location- ~/.codex/config.toml
Universal OAuth URL- https://always-on.cloud/mcp
Workspace URL- https://always-on.cloud/t/YOUR-WORKSPACE/mcp
- Add AlwaysOn to Codex
Run this one-shot command in your terminal. It sets ALWAYSON_MEMORY_KEY, adds AlwaysOn to ~/.codex/config.toml, and verifies the live connection automatically.
Terminal (install + instant live verify)export ALWAYSON_MEMORY_KEY="YOUR_CONNECTION_KEY" && \ codex mcp add alwayson --url "https://always-on.cloud/t/YOUR-WORKSPACE/mcp" --bearer-token-env-var ALWAYSON_MEMORY_KEY && \ curl -fsS -X POST "https://always-on.cloud/t/YOUR-WORKSPACE/mcp" -H "Authorization: Bearer $ALWAYSON_MEMORY_KEY" -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -d '{"jsonrpc":"2.0","id":"setup","method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"codex","version":"1.0"}}}' >/dev/null && \ echo "✓ AlwaysOn connected & verified! Start a new Codex session (or run /mcp)." - Load the memory tools in Codex
Add the export line to ~/.zshrc (or ~/.bashrc) so future Codex sessions keep the key, then launch Codex.
Notes: Manual ~/.codex/config.toml alternative: [mcp_servers.alwayson] with url = "https://always-on.cloud/t/YOUR-WORKSPACE/mcp" and bearer_token_env_var = "ALWAYSON_MEMORY_KEY".
How do I verify Codex recalls memory across sessions?#
Save one harmless decision, open a brand-new session so chat history is empty, and ask Codex to recall it. If it comes back accurately, the setup works—and the dashboard Setup screen logs the save, the new initialize handshake, and the retrieval.
- Save one test decision
In Codex, ask: "Save to AlwaysOn memory as a project decision: we ship the smallest useful version first."
- Check recall in a fresh session
Open a new chat or restart Codex, then ask: "Check AlwaysOn memory: what did we decide about the first release?"
- Confirm it in the dashboard
Open Memory or Setup in AlwaysOn to see the saved memory page and the server-observed MCP events.
How do I fix common Codex connection errors?#
Most Codex setup problems come down to four things: a mistyped or revoked connection key (HTTP 401), hitting the Free browser-approved app limit (HTTP 402), a wrong workspace slug (HTTP 403), or a session that hasn't reloaded ~/.codex/config.toml yet.
Why does Codex get HTTP 401 from AlwaysOn Memory?
HTTP 401 means the connection key is missing, mistyped, or revoked. Create a new connection key under Connections in AlwaysOn, replace YOUR_CONNECTION_KEY in ~/.codex/config.toml, and reload Codex.
Does Codex need a separate connection key for each repo?
No. One connection key connects Codex to your whole workspace, and you separate repos with the project parameter (for example project: "billing-api"). Every plan includes up to 25 active connection keys.
Why didn't Codex show AlwaysOn tools right after I edited ~/.codex/config.toml?
Most editors and CLIs read MCP config only when a session starts. Reload the window, refresh the MCP panel, or open a new Codex session so it runs a fresh initialize and tools/list handshake.