# Persistent memory across MCP clients (Claude, Cursor, Gemini CLI, Codex)

> Source: <https://dev.to/owlmem-team/persistent-memory-across-mcp-clients-claude-cursor-gemini-cli-codex-51pi>
> Published: 2026-11-30 20:05:31+00:00

**Key takeaway:** Pointing Claude Code, Cursor, Gemini CLI and Codex at a single HTTP MCP endpoint (https://mcp.owlmem.com/mcp) lets any client recall kb_write documents and kb_retain facts saved by another, with kb_find searching both by meaning and keywords.

Every AI coding client has some kind of memory, and none of it leaves that client. Claude's memory stays in Claude, Cursor's rules live in files on your machine. Switch clients mid-task and you start from zero — again.

The fix is a memory layer outside all of them: one MCP server every client connects to, holding the same knowledge base and facts. This guide connects Claude, Cursor, Gemini CLI, and Codex to OwlMem, so a decision recorded by one is recallable by the rest, in any later session.

Every client below connects to one URL:

```
https://mcp.owlmem.com/mcp
```

The fastest way is to let the installer do all four at once — it finds the AI apps on your computer, merges OwlMem into their config files, and backs up anything it changes:

```
npx -y owlmem install
```

Or add each one by hand. The first connection opens an OwlMem page: sign in with your email, name the AI, and click **Allow**. No keys to copy.

**Claude Code.** The easiest route is the plugin, which also teaches Claude Code when to look things up and when to save what it learned:

```
/plugin marketplace add owlmemhq/owlmem-claude
/plugin install owlmem@owlmem
```

Then type `/mcp`, select `owlmem`, and choose **Authenticate**. Or add the server directly:

```
claude mcp add --transport http --scope user owlmem https://mcp.owlmem.com/mcp
```

**Cursor.** Add the entry to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):

```
{
  "mcpServers": {
    "owlmem": { "url": "https://mcp.owlmem.com/mcp" }
  }
}
```

Then open **Cursor Settings → MCP**. OwlMem shows **Needs login** — click it and approve in the browser.

**Gemini CLI.** Install the OwlMem extension, then authenticate:

```
gemini extensions install https://github.com/owlmemhq/owlmem-gemini
/mcp auth owlmem
```

Or add it to `~/.gemini/settings.json` by hand:

```
{
  "mcpServers": {
    "owlmem": { "httpUrl": "https://mcp.owlmem.com/mcp" }
  }
}
```

**Codex.** Adding the server starts the sign-in right away:

```
codex mcp add owlmem --url https://mcp.owlmem.com/mcp
```

If the browser step timed out, run `codex mcp login owlmem`. Or add it to `~/.codex/config.toml` by hand:

```
[mcp_servers.owlmem]
url = "https://mcp.owlmem.com/mcp"
```

Every connected AI shows up in the console under **Agents & tools → Agents**. The Free plan covers two AIs forever; add more on a paid plan.

OwlMem keeps two kinds of memory, and both are shared:

`kb_write`, `kb_read`): longer pages — how a system works, the fix that took an afternoon, a project record. Plain Markdown, and every change is a git commit you can diff and revert.`kb_retain`, `kb_recall`): short facts — a decision, a preference, a version. Facts that change keep only their current value when you pass a key; give them an expiry or a snapshot so they retire on their own.
One search covers both: `kb_find` searches documents, files, and memory at once, by meaning and keywords. A client asking about the auth refactor gets answers recorded by any other client, in any earlier session. Memories are stored as written — no model rewrites them, and OwlMem never reads your chats to extract them.

Add these lines to `CLAUDE.md`, your Cursor project rules, and `GEMINI.md` (the installer adds them to `~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, and `~/.gemini/GEMINI.md` for you):

```
## Team memory (OwlMem)
- Before reading code or files, search OwlMem with kb_find (documents, files and memory at once); use kb_search only for an exact string such as a commit id, a path or an error message.
- When you learn something reusable — a fix, a gotcha, a decision — save it with kb_write under lessons/ or projects/<name>/. Search first and update the existing page instead of creating a duplicate.
- Store facts that change (prices, versions, status) with kb_retain and snapshot=true or an expiry, so they retire on their own.
- Never put passwords or API keys in documents or memory. Use the OwlMem vault.
```

The habit that makes persistence real: at the end of a chunk of work, have the AI record what's done and what's left. The next session, in any client, starts from that record instead of from zero.

Scripts, CI jobs, and older clients can't do the browser sign-in. For those, create a token in the console under **Agents & tools → Connect an AI** and send it as a bearer token:

```
claude mcp add --transport http owlmem https://mcp.owlmem.com/mcp --header "Authorization: Bearer $OWLMEM_TOKEN"
```

Tokens start with `om_`, don't expire, and you revoke one in the console. For a client that only runs local (stdio) servers, bridge it with `mcp-remote`:

```
{
  "mcpServers": {
    "owlmem": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.owlmem.com/mcp", "--header", "Authorization: Bearer ${OWLMEM_TOKEN}"],
      "env": { "OWLMEM_TOKEN": "om_…" }
    }
  }
}
```

In Claude Code, save a fact: *Remember in OwlMem that this project pins Node 22.* Then ask a fresh Gemini CLI session: *What Node version does this project use?* If it doesn't know, check the connection first (`/mcp` in Claude Code or Gemini CLI, **Settings → MCP** in Cursor, `codex mcp login owlmem` for Codex) — and check the fact was saved with `kb_retain`, not just said in a chat.

Claude (web, desktop, and mobile), Claude Code, Codex, ChatGPT, Cursor, VS Code, Windsurf, and Gemini CLI — plus any client that supports remote MCP servers with OAuth. Setup for each is in the [docs](https://owlmem.com/docs).

No. It never sees your prompts or chat history. An AI saves something only when it calls `kb_retain` or `kb_write`, and it is stored as written.

Two AI agents, 200 MB of storage, and 200 memory writes a month. Searching and reading are unlimited on every plan; paid plans raise the limits, and every plan gets every feature.

Bridge it with `mcp-remote` and a token, as shown above — the same route works for scripts and CI jobs.
