mcp-memory-server
Click on "Install 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., "@mcp-memory-serverRemember that Alice is working on the login feature."
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.
MCP Memory Server
A knowledge-graph-based persistent memory server for the Model Context Protocol (MCP). Stores entities, observations, and relations in SQLite with semantic vector search, temporal versioning, and cursor-based pagination.
Attribution
This project is derived from @modelcontextprotocol/server-memory by Anthropic, PBC, originally published under the MIT License as part of the MCP Servers monorepo. The original LICENSE file is preserved in this repository.
Related MCP server: MCP Memory Server
Features
SQLite storage with WAL mode, foreign key constraints, and database-level deduplication
Semantic vector search via sqlite-vec + local ONNX embeddings (384-dim;
all-MiniLM-L6-v2by default, swappable viaMEMORY_EMBED_MODEL)Relevance-ranked search —
search_nodeswithorderBy: 'relevance'fuses LIKE, BM25 full-text, vector, and activation signals via reciprocal-rank fusionTemporal versioning — observations and relations track
superseded_attimestamps; old data is preserved for history but hidden from active queriesPoint-in-time queries —
as_ofparameter on read/search operations recovers the graph state at any past timestampEntity soft-delete —
delete_entitiesmarks entities as superseded (preserving history) rather than hard-deletingEntity name normalization — surface variants like
Dustin-Space,dustin/space, andDUSTIN SPACEall resolve to the same identity keyObservation metadata —
importance(1-5 scale),context_layer(L0/L1/null),memory_typeclassification, and caller-supplied valid-time (validFrom/validUntil) on observationsContext layers —
get_context_layersreturns L0 (always-loaded rules) and a two-tier L1 (session-start context): a featured tier of full text plus a per-entity breadcrumb index for the overflow, both under char budgetsSession-start briefing —
get_summaryreturns top observations by importance, recently updated entities, and aggregate statsEntity timeline — view full change history (active + superseded + tombstoned observations and relations)
Similarity detection —
add_observationswarns when new observations are semantically similar to existing onesFour-tier eviction — Active → Superseded → Tombstoned → Hard-deleted degradation chain with 6-month LRU shield and configurable size cap (default 1 GB)
Cursor-based pagination — sorted by most-recently-updated, stable under concurrent use
Project scoping — optional
projectIdparameter isolates entities by projectAuto-migration — an existing JSONL file is upgraded to SQLite automatically on first run (the JSONL backend itself was retired in v1.6.0)
Installation
npm install
npm run buildNote:
better-sqlite3is a native C addon. You'll need C build tools (gcc, make) installed. On Fedora:sudo dnf install gcc make. On Ubuntu/Debian:sudo apt install build-essential.
Full harness install (recommended for Claude Code)
The server alone provides the storage layer. To replicate the full session-lifecycle integration — auto-loaded L0 context, freshness scanning, pre/post-compact agents, noise gating, /audit-memory and /checkpoint skills, custom QA agents — see harness/README.md:
cd harness
./install.shThe installer is idempotent, backs up existing files, and prints the manual integration steps (settings.json merge, MCP registration, CLAUDE.md fragments) at the end.
Usage
With Claude Code
Add to your MCP server configuration:
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/mcp-memory-server/dist/index.js"],
"env": {
"MEMORY_FILE_PATH": "/path/to/your/memory.db"
}
}
}
}Environment Variables
Variable | Default | Description |
|
| Path to the SQLite database file ( |
|
| Set to |
|
| Database size cap for the eviction system. Eviction triggers at 90% of cap |
|
| Embedding model ID. Switching models requires a restart; stale vectors are cleared and re-embedded automatically |
|
| Pooling strategy ( |
| `` (empty) | Instruction prefix applied to query-side embeddings only (for asymmetric retrieval models) |
|
| Cosine gate for the |
|
| Cosine gate for |
|
| Minimum cosine for |
|
| Cosine gate for |
Tools
Tool | Description | Key Parameters |
| Create new entities in the knowledge graph |
|
| Create directed relations between entities |
|
| Add observations to existing entities. Returns |
|
| Soft-delete entities (preserves history for |
|
| Delete specific observations from entities |
|
| Delete relations between entities |
|
| Atomically retire old observations and insert replacements. Preserves history |
|
| Mark relations as no longer active. Preserves history. Idempotent |
|
| Update importance, context layer, memory type, valid-time, and/or summary on existing observations in-place |
|
| Read the knowledge graph (paginated, sorted by most recently updated) |
|
| Search entities by name, type, or observation content. LIKE + semantic vector search; optional relevance ranking |
|
| Retrieve specific entities by name with full relations |
|
| Pre-write semantic duplicate check — embeds candidates and reports similar existing observations without writing |
|
| Bounded multi-hop graph traversal from a seed entity. Structure-only, with directed-cycle detection |
|
| Similarity-ranked observation retrieval — the most semantically similar prior observations to a query, scored |
|
| List all project names in the knowledge graph | — |
| Full change history for an entity (active + superseded + tombstoned items) |
|
| Returns L0/L1 observations sorted by importance with token budgets (two-tier L1: featured text + breadcrumb index) |
|
| Session-start briefing: top observations, recent entities, aggregate stats |
|
| Store a "when situation X arises, remember Y" trigger, matched semantically against future context (one-shot) |
|
| Fire any pending triggers whose condition semantically matches the current context. Call at session start / on project switch |
|
| List triggers (pending only by default) for management |
|
| Hard-delete triggers by id (deliberate exception to the preservation lifecycle — triggers are ephemeral intent). Idempotent |
|
Data Model
Entities — named nodes with a type, a project scope, and timestamped observations. Entity names are normalized (case-insensitive, separator-insensitive) for identity matching while preserving the original display form.
Relations — directed edges between entities with temporal tracking (
createdAt,supersededAt)Observations —
{ content, createdAt, importance, contextLayer, memoryType }objects attached to an entity (the atomic unit of knowledge)
Temporal Versioning
Observations, relations, and entities support a four-tier lifecycle:
Active items appear in
read_graph,search_nodes, andopen_nodesSuperseded items are hidden from active queries but preserved for history and
as_ofrecoveryTombstoned items have their content stripped by the eviction system but preserve the existence skeleton
Hard-deleted items are permanently removed when under extreme size pressure
Use
entity_timelineto see the full history of any entity (all tiers)Use
as_ofparameter onread_graph/search_nodes/open_nodesto recover the graph at any past timestamp
Vector Search
Vector search is automatic when using the SQLite backend:
Uses
sqlite-vec(brute-force KNN) with local ONNX embeddings (384 dimensions;all-MiniLM-L6-v2by default, configurable viaMEMORY_EMBED_MODEL)Model downloads ~23MB on first startup (cached thereafter)
LIKE substring search always runs; vector search adds supplementary semantic matches
Set
MEMORY_VECTOR_SEARCH=offto disableIf the model fails to load, the system degrades gracefully to LIKE-only search
Storage Backends
SQLite (default, recommended)
SQLite is the default and recommended backend. Features: WAL mode, FK constraints, database-level deduplication, vector search, temporal versioning, schema migrations.
JSONL (retired in v1.6.0)
The JSONL flat-file backend was deprecated since v1.0.0 and removed in v1.6.0. SQLite is now the only live backend. The one-time upgrade path remains: point MEMORY_FILE_PATH at an existing .jsonl file (or keep the same path across the upgrade) and the server migrates it into SQLite once. A .jsonl path with no file behind it errors, since there is nothing to migrate.
Migration from JSONL
Change
MEMORY_FILE_PATHto a.dbpath (or point it at your existing.jsonl— the server redirects to the sibling.db)On first run, the server auto-migrates data from the
.jsonlfile into SQLite in a single transactionThe original JSONL file is renamed to
.jsonl.bak
Known Limitations
Entity names are globally unique across all projects (relations use names as FK)
Project filtering is advisory, not a security boundary
Paginated relations use either-endpoint semantics — each page carries every relation touching one of its entities (the partner may be on another page; it's a name —
open_nodesit for content). The deduped union across all pages is the complete active relation setVector search is best-effort — degrades to LIKE-only if model/extension unavailable
vec0 is brute-force KNN — fine at current scale, consider ANN at ~50,000+ observations
Context layers and memory types are caller-managed — the server stores them but does not auto-classify
See CLAUDE.md for detailed architecture documentation and the full limitations list.
Development
npm test # run tests (539 non-vector tests across 17 files, plus the opt-in 16-test vector-integration suite)
npm run test:watch # run tests in watch mode
npm run build # compile TypeScript
npm run watch # compile in watch modeSet SKIP_VECTOR_INTEGRATION=1 to skip the vector integration tests (which load the embedding model) for faster CI runs. The vector-integration suite should be run single-fork (it loads a real ONNX model) — see MEMORY_VECTOR_SEARCH/SKIP_VECTOR_INTEGRATION and the test-pool notes in CLAUDE.md.
License
See LICENSE for the full text and original copyright notices. The upstream project is transitioning from MIT to Apache-2.0; documentation is licensed under CC-BY-4.0.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dustinspace217/mcp-memory-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server