Guides
How do I add a memory MCP server to Claude Code and check it works?
Add a local or HTTP memory MCP server, choose a scope, authenticate, and verify a real save and fresh-session read in Claude Code.
For Cairn.ink Memory, run npx @cairn-ink/memory setup and choose Cloud for automatic capture and prompt recall, or Local for no-account explicit tools on one computer. For other servers, use their documented claude mcp add command and authenticate through /mcp. Check either path by saving a harmless record and retrieving it in a fresh session.
What do I need before adding the server?
You need Claude Code and a memory server with a documented Claude Code or compatible MCP connection. MCP is the Model Context Protocol, which allows an assistant to call tools in another program or service. A memory connection should provide both a place to save context and a way to retrieve it later.
Find the official server documentation first. Identify whether the client starts a local process or connects to a remote HTTP endpoint. Then check where the data lives, how the service authenticates and whether saving conversation text is automatic or requires tool calls. These details differ even between modes of the same product.
This walkthrough starts with Cairn.ink Memory, then shows manual HTTP registration and a local stdio example. Claude Code commands and scope behavior follow the official MCP reference, accessed 2026-11-12.
How do I use the Cairn.ink Memory installer?
Install Node 22.16 or later and make sure the selected CLI is on your path. Then run:
npx @cairn-ink/memory setup
Choose Cloud to sign in to cairn.ink and enable automatic capture and prompt recall. To choose it directly:
npx @cairn-ink/memory setup --cloud
npx @cairn-ink/memory status
The installer finds Claude Code and Codex and asks about new connections. If you connect both, fully close them and wait for background work before confirming sharing. One browser sign-in connects a first paired installation, and a memory ID links the same project across tools. Reopen the clients after setup; in Codex, review the four Cairn hooks in /hooks.
For free, no-account use on one computer, choose Local, or run:
npx @cairn-ink/memory setup --local
Local offers explicit tools without automatic capture or cross-computer sync. Its semantic recall needs a configured model key; saving and inspecting work without one. Follow the installer README for existing-install conflicts and mode changes.
Cloud saves conversations after best-effort local masking and sends a masked, length-limited prompt copy for recall. Review the privacy controls. A paired installation provides these controls:
npx @cairn-ink/memory pause
npx @cairn-ink/memory resume
npx @cairn-ink/memory prompt-recall-off --client codex
npx @cairn-ink/memory config --codex-daily-cap 300
Paused conversations are skipped. Codex prompt-recall-off keeps capture and MCP available. If today's counter exists, the capture cap changes at the next daily reset. Codex defaults to 200 captures per day, existing installations keep their cap, and Claude's quota is separate.
Which scope should I use?
Choose a scope before running the add command. It determines where the connection is configured, not who owns the server's stored memories.
| Scope | Intended use | Configuration boundary |
|---|---|---|
| Local | Your connection in one project | Private project-specific configuration |
| Project | A server definition shared with repository collaborators | Repository MCP configuration |
| User | Your connection across projects | Your user configuration |
Use --scope local, --scope project or --scope user in the add command.
For project scope, the shared definition lives in: .mcp.json
Each teammate authenticates independently; the server decides what that identity can read. Do not put a personal access token in a file intended for version control.
User scope is a useful starting point for a personal memory service across repositories. Local scope can isolate a trial to one project. Avoid duplicate entries with the same name in several scopes; a more specific entry can shadow the one you meant to test.
How do I add hosted explicit tools manually?
For explicit tools only, use the alternative from the release README:
claude mcp add --transport http --scope user cairn https://cairn.ink/api/mcp
claude mcp list
claude mcp get cairn
Start Claude Code and open: /mcp
Select the server's authentication option and complete browser OAuth using your intended account. Return to the session and confirm that its memory tools are available. This manual path provides explicit remembering, recalling and forgetting. Use the installer above when you want automatic capture and prompt recall.
If your organization manages allowed servers or project trust, the connection may require the corresponding local approval before it can run. Check the client message instead of repeatedly adding another definition. Confirm an authenticated tool call after the server is registered.
How is OAuth different from a token?
OAuth opens a browser authorization flow so the client receives access without you manually placing a reusable secret in the project. The Cairn.ink Memory HTTP example uses this flow through the server panel. Sign into the account whose private Memory you expect to use.
Other servers may require a personal access token or API key, often sent as an authorization header or supplied to a local process through its environment. Follow that provider's exact format and secret-storage guidance. A token belonging to the wrong account can produce a valid connection to the wrong store.
If access is rejected, verify the documented URL, account and authentication method together. Keep service-specific credentials with their intended endpoint, and use the provider's supported secret mechanism.
What changes for a local stdio server?
A stdio server is a program that exchanges MCP messages through standard input and output. Claude Code launches it locally. Check its provider configuration to understand any additional online API calls.
For example, the MCP reference memory server, accessed 2026-11-12, stores a local knowledge graph. Its documentation recommends selecting an owned persistent storage path. Replace the absolute placeholder below with your own path in an existing writable directory:
claude mcp add --env MEMORY_FILE_PATH=/absolute/path/memory.jsonl --transport stdio --scope user memory -- npx -y @modelcontextprotocol/server-memory
The -- separator marks the start of the server command; everything after it is passed to that program. Keep durable data outside a package cache. Use the tool names exposed by the server you installed.
How do I verify a real save and later recall?
In the hosted worked example, ask Claude Code:
Use remember_memory to save this in personal scope:
For the fictional Willow demo, I prefer review summaries with the conclusion first.
Show the Memory ID and Source Receipt from the tool response.
Read the tool response. A Memory is private user-owned context. Its Source Receipt provides the source excerpt and client metadata for inspection. Keep the identifier and source for your own comparison.
Start a fresh Claude Code session without copying the answer into it:
Use recall_memory to find my review-summary preference for the Willow demo.
Show the Memory ID and Source Receipt, or report no matching result.
Compare identifiers and source text. If they match, this example shows persistence across sessions. If another client will use the store, repeat there as a separate cross-client check.
Once the test is finished, you can ask the assistant to forget that exact test identifier and check the tool's result. Forgetting removes active recall availability while storage history and backups have separate retention. A Knowledge Card has its own review and human-authorized publication process.
What should I check when something fails?
If the server is absent, check its scope and the directory where you launched Claude Code. If a local process fails to start, check its executable, runtime and file permissions. For HTTP failures, check the endpoint, network and authentication. Read the actual error before changing settings.
If tools are visible but recall is empty, check that a save really succeeded, then check account, scope and query wording. A personal-scope test avoids requiring a shared opaque project identity. Resolve timeouts and authentication errors before trying search again.
For the automatic installation, check an ordinary conversation capture as well as explicit tools. status reads local state; it does not verify remote service or hooks.
Use the connection guide to finish setup in your chosen clients.
Frequently asked questions
- Which MCP scope should I choose?
- Use local scope for your use in one project, project scope for a shared repository configuration, and user scope for your own connection across projects.
- Does a connected status prove memory works?
- No. Save a harmless record, inspect the actual response, and retrieve it from a fresh session without supplying the answer.
- Does a memory MCP server capture conversations automatically?
- The Cairn.ink Memory Cloud installer enables automatic capture and prompt recall. Manual MCP registration provides explicit tools only; Local uses explicit tools without automatic capture.
- Should I paste a token into a committed config?
- No. Use the provider-supported secret mechanism. For the hosted example here, browser OAuth avoids putting a token in project configuration.