Connect your agent
Pensieve for Codex
This page tells you how to connect Codex to Pensieve over MCP, and what changes on your computer.
Connect Codex
- Install Pensieve (see Install).
- Run one of these commands:
pensieve integrate recommended # every agent on this computer pensieve integrate codex-mcp codex pensieve-search # only Codex - Restart Codex. It loads its MCP servers when it starts.
- Ask Codex a question about your code, for example “where do we retry failed webhooks?”.
What Pensieve adds
| Add-on | Id | File |
|---|---|---|
| MCP server | codex-mcp | ~/.codex/config.toml |
| Instructions block | codex | ~/.codex/AGENTS.md |
| Skills | pensieve-search | ~/.agents/skills |
The instructions block goes in ~/.codex/AGENTS.md, between <!-- pensieve:start --> markers.
Connect by hand
Add this entry to ~/.codex/config.toml. Use the full path of your pensieve command. To find it, run
which pensieve.
# pensieve:start
[mcp_servers.pensieve]
command = "/Users/you/.local/bin/pensieve"
args = ["mcp"]
# pensieve:end
Pensieve writes its entry between the lines # pensieve:start and # pensieve:end.
When you remove it, the rest of config.toml stays the same. If config.toml already has a
server named pensieve that Pensieve did not add, Pensieve does not change it.
Pensieve indexes your Codex sessions from ~/.codex/sessions. Thus search with
kind:session also finds earlier Codex work.
Remove
pensieve integrate codex-mcp codex --remove
Pensieve removes only the entries that it added.
See also: scopes, the MCP tools, and the benchmark.
Something wrong or missing? Tell us on GitHub.