> Connect Codex to Bilinc Cloud for durable agent memory: recall before risky edits, commit verified outcomes and capture the session at close.

Canonical page: https://bilinc.space/for/codex

- [Connect](https://bilinc.space/mcp)
- Codex

# Give Codex memory beyond one thread.

Bilinc lets Codex recall the decisions a project already made before it edits, and keep what each session settled, so you stop rebuilding the same context at the start of every thread.

[Start free](https://bilinc.space/signup) [Codex guide](https://bilinc.space/docs/codex) [Remote MCP guide](https://bilinc.space/docs/remote-mcp)

## Set it up.

Codex connects to the hosted server at `https://mcp.bilinc.space/mcp` and signs in with OAuth, so there is no key to copy.

- **Add the server.** Codex connects to the hosted server with two commands.Terminal

```
codex mcp add bilinc --url https://mcp.bilinc.space/mcp
codex mcp login bilinc
```

- **Sign in.** Bilinc opens in your browser to sign you in. On the approval screen you choose the workspace and whether the connection is read-only or read and write.

- **Give Codex the memory contract.** Paste the contract below into the instructions Codex reads for this project, so it recalls before risky edits and commits outcomes at the end.

### Or use the local adapter

Codex can also run the local adapter from the bilinc package. Install it, sign in, and add the server to `~/.codex/config.toml`.
Terminal

```
pip install -U bilinc
bilinc login
```

~/.codex/config.toml

```
[mcp_servers.bilinc]
command = "python3"
args = ["-m", "bilinc.cloud_mcp"]
```

## What it changes for Codex.

Long engineering work outlives a Codex thread. The next thread does not know which approach was tried and dropped, which test is flaky for a known reason, or what the last sprint left open. With Bilinc, Codex recalls that state before it changes code, and each result says where the memory came from and when it was last written or confirmed.
At the end of a session Codex commits what is worth keeping: the outcome, the commands that verified it, the files it changed and the caveats. Each memory records which app wrote it, and every change keeps its earlier versions, so a teammate can see how a decision evolved.
Before a risky change Codex can create a snapshot. If the run goes wrong, diff lists what changed since then, and rollback restores that checkpoint after a preview.

## Things to ask.

Ask in your own words; the agent picks the Bilinc tool that fits.

- “Recall what Bilinc has on this repo's deployment before you change the pipeline.”
- “Create a Bilinc snapshot named before the auth migration, then start.”
- “What changed in Bilinc since the last snapshot? Show the diff.”
- “Commit this sprint's outcome to Bilinc: files changed, verification commands and open caveats.”

### The memory contract

Paste this into the instructions Codex reads, so it recalls before it acts and keeps only what is worth keeping.

Instructions for your agent

```
Use Bilinc Cloud as durable memory for this Codex task.
Recall before risky edits.
Commit final outcomes, verification commands, files changed, and caveats.
Never save secrets, cookies, tokens, private keys, or raw API keys.
```

## What it can do.

The connector’s tools, as the remote MCP guide lists them. A read-only connection only sees the four read tools. Whether Codex asks before a tool runs is up to Codex.

The tools of the Bilinc connector| Tool | What it does | Access |
| `recall` | Search memory; each result carries its source, last update and version, and a marker when it is past its review window. | read |
| `list_snapshots` | List saved checkpoints. | read |
| `diff` | Compare a checkpoint with the current state or another checkpoint. | read |
| `status` | Workspace, plan, credits and whether this connection can write. | read |
| `remember` | Store a new memory. Never overwrites an existing key. | write |
| `create_snapshot` | Save a checkpoint of the whole workspace. | write |
| `preview_rollback` | Show what a rollback would change and issue a confirmation token. | write access, changes nothing |
| `revise` | Replace a memory, or confirm it by sending the same value; the old value stays in history. | write |
| `forget` | Remove a memory from recall, with a recorded reason. | write |
| `rollback` | Restore a checkpoint using the preview token. | write |
| `dream_start` | Start tidying memory: the entries changed since the last dream, for Claude to review. | write |
| `dream_apply` | Merge duplicates, retire stale entries, keep or flag the rest; undo with dream_undo. | write |
| `dream_undo` | Undo a dream's own changes in one step, for 7 days. | write |

[The remote MCP guide](https://bilinc.space/docs/remote-mcp)

## Questions.

### Does Codex need an API key for Bilinc?

Not with the hosted server. codex mcp login opens bilinc.space and signs you in. The local adapter reads the key that `bilinc login` saved; only a machine without a saved key needs `BILINC_API_KEY` in the server's environment.

### Is the memory shared with my other tools?

Yes. Every app connected to the same workspace shares its memory: what Codex saves, Claude and ChatGPT can recall. Each memory records which app wrote it.

### Can Codex overwrite a memory by mistake?

remember only creates new keys. Changing an existing memory goes through revise, and the earlier version stays in the history. A read-only connection cannot write at all.

### How do I undo a bad run?

Create a snapshot before risky work. If a run writes something wrong, diff shows what changed since that checkpoint, and rollback restores the workspace to it after a preview. Rollback works on checkpoints, not on single keys.

### What should Codex never store?

Secrets. The contract tells Codex never to save secrets, cookies, tokens, private keys or raw API keys, and memory values should hold decisions and outcomes, not credentials.

## Bilinc connects the same way everywhere.

One workspace, every client. The memory guides and comparisons answer the questions underneath.

[Claude CodeThe connector or the local adapter, from the terminal](https://bilinc.space/for/claude-code) [CursorThe local adapter in mcp.json](https://bilinc.space/for/cursor) [ChatGPTA custom MCP server with one URL](https://bilinc.space/for/chatgpt) [Claude DesktopA custom connector, also on claude.ai and mobile](https://bilinc.space/for/claude-desktop) [VS CodeThe local adapter in .vscode/mcp.json](https://bilinc.space/for/vscode) [Gemini CLIThe local adapter in settings.json](https://bilinc.space/for/gemini-cli) [Devin DesktopThe local adapter in mcp_config.json, or devin mcp add](https://bilinc.space/for/devin-desktop) [opencodeThe local adapter in its MCP settings](https://bilinc.space/for/opencode) [Hermes-AgentThe local adapter over stdio](https://bilinc.space/for/hermes-agent) [Any MCP clientThe generic MCP server setup](https://bilinc.space/for/mcp) [Coding agentsThe memory contract for repo-aware agents](https://bilinc.space/for/coding-agents) [Agent memory guidesWhat agent memory is, and where vector search stops](https://bilinc.space/answers) [CompareBilinc next to other memory layers](https://bilinc.space/compare)
