memanchor
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@memanchor recall what we decided about JWT signing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
⚓ memanchor
Persistent memory for coding agents that knows when it's out of date.
Claude Code, Cursor and Codex forget everything between sessions. memanchor is a local MCP server that lets them save what they learn (decisions, conventions, gotchas) and recall it next time.
The difference: every memory is anchored to the files it describes. When those files change, recall flags the memory as STALE, so the agent re-checks before acting on outdated knowledge.
> recall "jwt signing"
1 memory, 1 stale (verify before relying on them)
#4 [decision] (STALE: src/auth/keys.ts changed; tags: auth, jwt)
JWTs are signed with RS256 so other services can verify them with the public key only.Why
A wrong memory is worse than no memory. Most agent-memory tools store text and return it forever, even after the code it describes has been rewritten. memanchor treats memory like a cache that can be invalidated:
Plain notes / CLAUDE.md | Typical memory server | memanchor | |
Persists across sessions | ✅ | ✅ | ✅ |
Searchable | grep | ✅ | ✅ BM25 + stemming |
Knows when a memory may be outdated | ❌ | ❌ | ✅ file anchors |
Scrubs secrets before saving | ❌ | rarely | ✅ |
Bounded context cost | ❌ whole file | varies | ✅ token budget |
Local, no cloud, no API key | ✅ | varies | ✅ |
Related MCP server: Ouso Code
Features
Staleness detection.
remember(files: [...])stores a content hash of each file.recallre-hashes and marks memories whose files changed or were deleted.confirm_memoryre-anchors after the agent re-checks.list_memories(stale_only)finds memories to clean up.Secret redaction. API keys (Anthropic, OpenAI, GitHub, AWS, Slack, Stripe, Google), JWTs, private keys,
password=style assignments and credentials in connection strings are replaced with[REDACTED:type]before anything touches disk, and the agent is told what was scrubbed.Relevance search. SQLite FTS5 with porter stemming ("migrating" finds "migrations"), prefix matching, and tags weighted into the BM25 ranking.
Token budget. Recall stops adding results at
max_tokens(default 1500), so memory can't flood the context window.Project isolation. One database, scoped per git repository. Paths outside the project are rejected.
Deduplication. Saving the same memory twice updates it instead of creating a copy.
Zero native dependencies. Uses Node's built-in
node:sqlite. Nothing to compile.
Install
Requires Node.js 22.13 or later.
Claude Code
claude mcp add memanchor -- npx -y memanchorCursor: add to .cursor/mcp.json
{
"mcpServers": {
"memanchor": { "command": "npx", "args": ["-y", "memanchor"] }
}
}Any MCP client: run npx -y memanchor as a stdio server.
The project is the git repository of the directory the server starts in. If your client starts
servers elsewhere, set MEMANCHOR_PROJECT=/path/to/repo. Memories are stored in
~/.memanchor/memory.db; override with MEMANCHOR_DB.
Tools
Tool | What it does |
| Save a memory. |
| Ranked search; no query returns the most recent. Flags stale results. |
| The memory still holds after re-checking; re-anchor it to the current files. |
| Delete a wrong or obsolete memory. |
| Review everything, or just what needs re-checking. |
The server also sends MCP instructions telling the agent to recall at the start of a task,
remember what a future session would need, and verify stale memories before relying on them.
CLI
For humans who want to see what their agent remembers:
npx memanchor list # all memories for this repo
npx memanchor list --stale # only ones whose files changed
npx memanchor search "auth"
npx memanchor stats
npx memanchor forget 12Evaluation
npm run eval measures whether recall puts the right memory first, on 24 memories from a fictional
e-commerce backend and 24 queries in three categories
(dataset). The baseline is substring matching, which is roughly what
grepping a notes file gives you.
system | category | queries | hit@1 | hit@3 | MRR |
substring | keyword | 8 | 100% | 100% | 1.00 |
substring | morphology | 8 | 50% | 63% | 0.59 |
substring | paraphrase | 8 | 38% | 38% | 0.38 |
memanchor (BM25) | keyword | 8 | 100% | 100% | 1.00 |
memanchor (BM25) | morphology | 8 | 100% | 100% | 1.00 |
memanchor (BM25) | paraphrase | 8 | 50% | 63% | 0.54 |
substring | all | 24 | 63% | 67% | 0.66 |
memanchor (BM25) | all | 24 | 83% | 88% | 0.85 |
Stemming and prefix matching fix word-form mismatches completely. Paraphrases are the weak spot: "where is the app hosted" shares no words with "Production runs on AWS ECS Fargate". That's the case for optional local embeddings (see roadmap). The dataset is small and hand-written, so treat these numbers as a regression check, not a benchmark.
Development
npm install
npm test # type-check + 37 tests, including the built binary over stdio
npm run eval # retrieval evalTests cover redaction patterns, staleness (changed, deleted, confirmed), dedup, path escapes, project isolation, FTS query sanitising, the token budget, and every tool through a real MCP client.
Roadmap
Optional local embeddings (hybrid BM25 + vector) to close the paraphrase gap
Anchor to symbols (a function, a config key) rather than whole files, so unrelated edits don't flag a memory
Memory decay: down-rank memories that are never recalled
Import existing
CLAUDE.md/.cursorrulesnotes as memories
License
MIT
Available Tools
5 toolsconfirm_memoryConfirm memoryAIdempotent
Mark a stale memory as still correct after re-checking the code. Re-anchors it to the current files.
Inputs: id (required).
forgetForgetADestructiveIdempotent
Delete a memory that is wrong or no longer applies.
Inputs: id (required).
list_memoriesList memoriesARead-only
List all memories for this project, optionally only one kind or only stale ones (for cleanup).
Inputs: kind, stale_only.
recallRecallARead-only
Search this project's memories by keywords (BM25 full-text search). Call at the start of a task. Omit query to get the most recent memories. Results flagged STALE refer to files that changed since.
Inputs: kind, limit, query, max_tokens.
rememberRememberAIdempotent
Save something future sessions on this project should know: a decision and why, a convention, a gotcha, a fact or a todo. Keep it to one self-contained statement. Identical memories are updated, not duplicated.
Inputs: content (required), kind, tags, files.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct action: remember creates/updates, recall searches, confirm_memory re-anchors stale entries, forget deletes, and list_memories enumerates/filters. The boundary between recall and list_memories is clear because one is keyword search and the other is full listing with kind/staleness filters.
All names use lowercase snake_case and are verb-oriented, but remember/recall/forget are bare verbs while confirm_memory/list_memories follow a verb_noun pattern. The inconsistency is minor and still readable.
Five tools is well-scoped for a project-memory server. Each tool covers a necessary lifecycle operation without redundancy.
The surface covers the full memory lifecycle: create/update (remember), search/read (recall), list/filter (list_memories), re-validate stale entries (confirm_memory), and delete (forget). No obvious gaps remain for the stated purpose.
Related MCP Connectors
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
An MCP memory server. One memory your agents share — across models, devices and apps.
Hosted MCP memory for coding agents: persistent across sessions, editable markdown, team sharing.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenancePersistent memory for AI coding agents. Enables agents to save and recall decisions, patterns, bugs, and context across sessions via an MCP server with local SQLite storage.16 npm2MIT
- FlicenseNot gradedqualityBmaintenanceA local, cross-editor MCP server that provides persistent memory for coding agents, capturing and recalling decisions, conventions, and fixes across sessions without API keys.-
- AlicenseAqualityBmaintenanceMCP server that gives coding agents persistent, verified memory of codebase decisions, conventions, and skills, with evidence-based claims that are re-checked via git hooks and human-gated review. Enables memory search, propose/approve, chat harvesting, and critique across MCP-compatible tools.21124 npm1MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to store, search, and recall persistent project and cross-project memories locally over MCP, keeping architectural decisions, conventions, and error patterns available across sessions. Also optionally exposes a task server for autonomous task execution driven by that same memory store.-