Memory layer — give your AI persistent memory across sessions
Claude Code's built-in memory is per-project. Codex has none. Adding mcp-nex (or local-memory-mcp) gives you durable, searchable memory that works across every MCP client you use.
Memory layer
Claude Code 2026 ships with auto-memory (per-project notes in ~/.claude/projects/.../memory/). It's good for "build commands and conventions" but bad for cross-project state, fuzzy search, or sharing memory between Claude Code, Codex, and Cursor.
A dedicated memory MCP server fixes that. Two paths:
- SaaS (recommended for cross-device): sign up at memory.studiomeyer.io, get an API key via magic link, point your MCP clients at the URL. Frankfurt-hosted, multi-tenant, OAuth 2.1.
- Local stdio (recommended for privacy): install
local-memory-mcpfrom npm, runs in-process, data lives in~/.local-memory/. No account, no cloud.
Both expose roughly the same tools (nex_search, nex_learn, nex_recall, nex_decide, knowledge-graph entities). Same API, different storage.
Step 1: Pick a path — SaaS or local
If you switch between machines (laptop + desktop, work + home), use SaaS. Memory follows you.
If you only work on one machine and want zero cloud, use local. No sign-up, no account.
You can have both — local for personal stuff, SaaS for shared / cross-device. They are independent MCP servers and don't sync.
Step 2A: Local install (privacy path)
claude mcp add memory -s user -- npx -y local-memory-mcp
Restart your Claude Code session. Memory data lives in ~/.local-memory/. Free, private, fast.
For Codex, in ~/.codex/config.toml:
[mcp_servers.memory]
command = "npx"
args = ["-y", "local-memory-mcp"]
Step 2B: SaaS install (cross-device path)
claude mcp add --transport http memory https://memory.studiomeyer.io/mcp
For Codex:
[mcp_servers.memory]
url = "https://memory.studiomeyer.io/mcp"
The first tool call from a fresh client triggers a magic-link flow:
- Browser opens to memory.studiomeyer.io with a code-challenge
- You enter your email
- Magic link arrives (Brevo SMTP, ~5 sec)
- Click link → token issued → MCP client stores refresh token (30-day TTL)
No password, no API key in config. The OAuth handshake is the auth.
Step 2: Smoke-test from Claude Code
Open a fresh Claude Code session and try:
"remember that this project uses Next.js 16 with the App Router"
Claude calls nex_learn with the content. Then:
"what do you remember about this project?"
Claude calls nex_search and the previous learning comes back. Memory works.
Step 3: Verify
Run aiguide_validate_step. The validator runs claude mcp list and looks for any server matching memory|nex|local-memory. If you installed both SaaS and local, you'll see two entries.
Step 4: First memory hygiene
Don't blindly say "remember everything I tell you". The memory store gets noisy fast.
Three good habits:
- Be explicit about importance. Say "save this as a learning" or "store this in memory". A trigger phrase helps the AI pick the right tool (
nex_learnvs nothing). - Project-tag everything. When you save a learning, mention the project name in the content. Memory tools support project filters — useful when you have a memory store across 10 projects.
- Search before you save. "Did I already store something about X?" → if yes, update; if no, save fresh. The gatekeeper inside
nex_learndoes this automatically with similarity-matching, but it helps to think about it.
Memory is the single highest-leverage MCP server you can install. Every other recipe in this guide is more useful with persistent memory because the AI remembers what you've already done.