Codex CLI Setup

Add Memcone memory to the OpenAI Codex CLI in under 60 seconds.

Run this in your project directory:

bash
npx @memcone/cli link
npx @memcone/cli link

link detects Codex CLI and writes the MCP config automatically. Restart Codex and you're done.

You need a Memcone API key from dashboard → API keys. The CLI will prompt for it on first run and save it to ~/.memcone/credentials.


Manual config

Use the Codex MCP CLI:

bash
export MEMCONE_API_KEY="mem_live_…"   # raw key; Codex sets Authorization
codex mcp add memcone --url https://memcone.com/api/mcp --bearer-token-env-var MEMCONE_API_KEY
export MEMCONE_API_KEY="mem_live_…"   # raw key; Codex sets Authorization
codex mcp add memcone --url https://memcone.com/api/mcp --bearer-token-env-var MEMCONE_API_KEY

Verify with:

bash
codex mcp list
codex mcp get memcone
codex mcp list
codex mcp get memcone

Or edit ~/.codex/config.toml directly:

toml
[mcp_servers.memcone]
url = "https://memcone.com/api/mcp"
http_headers = { Authorization = "Bearer mem_live_YOUR_KEY_HERE" }
[mcp_servers.memcone]
url = "https://memcone.com/api/mcp"
http_headers = { Authorization = "Bearer mem_live_YOUR_KEY_HERE" }

(http_headers is the documented field for static headers; the CLI does not support --header on codex mcp add.)


Using it

Codex calls Memcone automatically during sessions:

  • memcone.context — injects your project identity, rules, and past session memory
  • memcone.remember — stores facts the agent learns
  • memcone.recall — searches past memory on demand

"Remember that this repo uses ESM modules, not CommonJS"

"What do you know about my preferred testing approach?"


Troubleshooting

codex mcp list doesn't show memcone → Re-run codex mcp add or check your config.toml.

401 Unauthorized → Verify your key at dashboard → API keys. It must start with mem_live_.

No memory returned → Nothing is stored yet. Tell Codex: "Remember that this project uses TypeScript and Vitest". Confirm at dashboard → Memory.