MCP integration

Codex CLI

Wire the prom.codes context, memory and saver MCP servers into OpenAI's Codex CLI via ~/.codex/config.toml.

Codex supports stdio MCP servers, configured in ~/.codex/config.toml (or per project in .codex/config.toml for trusted projects). Each server is a [mcp_servers.<name>] table.

Codex kills an MCP server that takes longer than 10 seconds to start (startup_timeout_sec default). A cold npx download of the context server can exceed that, so install once globally and launch the built binaries directly — it starts in well under a second and is immune to npx cache issues:

npm install -g @prom.codes/context-mcp @prom.codes/memory-mcp @prom.codes/saver \
  --allow-scripts=better-sqlite3,tree-sitter
npm root -g   # prints <GLOBAL> — paste it into the paths below

(--allow-scripts=… is npm 11.16+/v12 syntax; on older npm use --ignore-scripts=false --foreground-scripts instead. Details in Troubleshooting → bindings.)

Then either run codex mcp add per server:

codex mcp add context --env PROMETHEUS_API_KEY=prom_live_… -- node <GLOBAL>/@prom.codes/context-mcp/dist/bin.js
codex mcp add memory  --env PROMETHEUS_API_KEY=prom_live_… -- node <GLOBAL>/@prom.codes/memory-mcp/dist/bin.js
codex mcp add saver   -- node <GLOBAL>/@prom.codes/saver/dist/bin.js

or write the TOML yourself:

[mcp_servers.context]
command = "node"
args = ["<GLOBAL>/@prom.codes/context-mcp/dist/bin.js"]
env = { "PROMETHEUS_API_KEY" = "prom_live_…" }

[mcp_servers.memory]
command = "node"
args = ["<GLOBAL>/@prom.codes/memory-mcp/dist/bin.js"]
env = { "PROMETHEUS_API_KEY" = "prom_live_…" }

[mcp_servers.saver]
command = "node"
args = ["<GLOBAL>/@prom.codes/saver/dist/bin.js"]

The PROMETHEUS_API_KEY is a prom_live_… key you mint at app.prom.codes → /app/api-keys; the same key unlocks context and memory, the saver needs none.

Workspace root

Clients that advertise the MCP roots capability (Cursor, VS Code) tell the servers which folder is open. When a client doesn't, the servers fall back to the directory they are started in — for Codex that is the folder you launched codex from, so starting Codex in the project root "just works". To pin it explicitly (e.g. a per-project .codex/config.toml that must never index the wrong folder), set the root yourself:

[mcp_servers.context]
command = "node"
args = ["<GLOBAL>/@prom.codes/context-mcp/dist/bin.js"]
env = { "PROMETHEUS_API_KEY" = "prom_live_…", "PROMETHEUS_WORKSPACE_ROOT" = "/absolute/path/to/repo" }

The usual guard rails apply either way: the server refuses to auto-index your home directory, a drive root, or a bare folder of many projects, and honours .gitignore + .prometheusignore — see What gets indexed.

Verify

Start codex in your project and ask it to run the index_status tool: it should report your project as the workspace root, files > 0 after the first index pass, and embeddings.reachable: true. The self-check prompt works in Codex unchanged.