Longterm Memory
What it does
A fully local MCP server for long-term memory with semantic search
- Connects Runs on your computer
- Account or key No key needed
- Category Search & AI memory
Install
Pick the AI app you use, then copy the settings.
Passed 3/3 checks · Runs on your computer
First: which AI do you use?
Pick your app and the steps appear below.
Works with Claude, with some setup first
Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
Install Node.js
One time only; it works for every server that needs Node.js
Open the Claude desktop app’s settings file
SettingsDeveloperEdit Config
Paste these settings and save the file
{ "mcpServers": { "longterm-memory": { "command": "npx", "args": [ "-y", "longterm-memory-mcp" ] } } }Quit Claude and open it again
Try it
Use Longterm Memory and tell me what you can do for me, then show me one thing✓ If Claude says it is using Longterm Memory or shows a Longterm Memory tool in the answer, you are connected
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
ChatGPT cannot connect Longterm Memory yet
Longterm Memory runs on your computer, but ChatGPT can only connect servers that run on the web
What you can do instead
A · Use an app that can connect Longterm Memory
- Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
- Install Node.js on your computer first (one time)
- Install Node.js on your computer first (one time)
- Install Node.js on your computer first (one time)
B · Others in Search & AI memory that work with ChatGPT
Picked from the most used in the same category, only ones that connect by address with no key
- AIHOT✓ ChatGPT
- Sui Knowledge Base (kapa.ai)✓ ChatGPT
- Exa✓ ChatGPT
Works with Claude Code, with some setup first
Install Node.js on your computer first (one time)
Install Node.js
One time only; it works for every server that needs Node.js
Open Terminal
Mac: press Command+Space and type Terminal · Windows: open PowerShell
Paste this command and press Enter
claude mcp add longterm-memory -- npx -y longterm-memory-mcpType /mcp in Claude Code
You should see Longterm Memory listed as connected
Try it
Use Longterm Memory and tell me what you can do for me, then show me one thing✓ If Claude Code says it is using Longterm Memory or shows a Longterm Memory tool in the answer, you are connected
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with Cursor, with some setup first
Install Node.js on your computer first (one time)
Install Node.js
One time only; it works for every server that needs Node.js
Open the AI chat in Cursor in Agent mode
Try it
Use Longterm Memory and tell me what you can do for me, then show me one thing✓ If Cursor says it is using Longterm Memory or shows a Longterm Memory tool in the answer, you are connected
Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with VS Code, with some setup first
Install Node.js on your computer first (one time)
Install Node.js
One time only; it works for every server that needs Node.js
Open the AI chat in VS Code in Agent mode
Try it
Use Longterm Memory and tell me what you can do for me, then show me one thing✓ If VS Code says it is using Longterm Memory or shows a Longterm Memory tool in the answer, you are connected
Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.
JSON settings are under “For developers” below
For developers: Terminal commands and JSON settings
Installed on your computer
Claude Code
claude mcp add longterm-memory -- npx -y longterm-memory-mcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"longterm-memory": {
"command": "npx",
"args": [
"-y",
"longterm-memory-mcp"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"longterm-memory": {
"command": "npx",
"args": [
"-y",
"longterm-memory-mcp"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"longterm-memory": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"longterm-memory-mcp"
]
}
}
}These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.
At a glance
Which apps can use it
Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.
Run on your computer in
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
Related guides
What it can do
Runs on your computer; the tool list appears in your AI app after you install it.
Basic checksi
We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 12, 2026
- ✓ Pass
Maker matches the repo
The registry name was verified with the GitHub account MarcelRoozekrans, which owns the repo
- ✓ Pass
Still maintained
Code last changed 5 days ago
- ✓ Pass
Has a licence
Uses MIT
- – Not applicable
Endpoint responds
This one runs on your computer; there is no internet endpoint
- – Not applicable
Sign-in with OAuth
Runs on your computer and uses local settings instead
- … Not checked yet
No hidden instructions in tool descriptions
Runs on your computer; we can only read tool lists from internet endpoints
Discussion
Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
User reviews
No reviews yet
Compared with others in Search & AI memoryi
- More stars than 81% of the other 5962 servers in this category
- Published to the registry more recently than 76% of the other 5962 servers in this category
- Basic checks equal to or better than 100% of the other 5962 servers in this category
Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.
Common questions
Is Longterm Memory safe?
It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.
What keys or codes does it need?
The registry does not list a required key, though some servers ask you to sign in on first use.
Does it run on my computer or in the cloud?
It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).
Is it still maintained?
The GitHub repo last changed 5 days ago, and the latest version (1.6.1) reached the registry 12 days ago.
Which apps can use it?
Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.
What can I use instead?
In the same category: Ruflo, Context7, Metabase
Alternatives
Servers in the same category from other makers, sorted by stars.
Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi
README from the maker
Open the README
Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.
LongtermMemory-MCP
A fully local MCP server that gives AI agents persistent, semantic long-term memory — without any cloud dependencies.
Inspired by mcp-mem0, but runs 100% on your machine:
| Feature | mcp-mem0 | This project |
|---|---|---|
| Storage | PostgreSQL / Supabase | SQLite (Node's built-in node:sqlite) |
| Embeddings | OpenAI API | Local transformer (all-MiniLM-L6-v2) |
| Vector search | Cloud vector DB | In-process cosine similarity |
| LLM dependency | OpenAI / OpenRouter / Ollama | None |
| Setup | Database + API keys | `npx longterm-memory-mcp` |
Tools
Core
| Tool | Description |
|---|---|
save_memory | Store text with auto-generated semantic embedding, tags, importance, and type |
search_memory | Find relevant memories using natural language queries (cosine similarity) |
update_memory | Modify an existing memory's content, metadata, tags, importance, or type |
delete_memory | Remove a specific memory by ID |
delete_all_memories | Wipe all memories (irreversible) |
get_all_memories | List all stored memories (paginated) |
memory_stats | Get count and database location |
Search
| Tool | Description |
|---|---|
search_by_type | Filter memories by category (general, fact, preference, conversation, task, ephemeral) |
search_by_tags | Find memories matching any of the provided tags |
search_by_date_range | Find memories created within a specific date range (ISO format) |
Maintenance
| Tool | Description |
|---|---|
create_backup | Manually trigger a database backup with JSON export |
Quick Start
Claude Code Plugin (recommended)
Install via the Claude Code marketplace — this sets up both the MCP server and a companion skill that teaches Claude how to use memory effectively:
/plugin marketplace add MarcelRoozekrans/LongtermMemory-MCP
/plugin install longterm-memory@longterm-memory-marketplace
This automatically:
- Configures the MCP server (no manual JSON editing), pinned to the plugin's version: a plugin update also updates the server
- Adds the automatic recall hook
- Installs the
long-term-memoryskill (Claude learns to recall context at session start, save insights after tasks, and deduplicate memories)
Use with npx (no install needed)
npx longterm-memory-mcp
npx keeps running the version it cached first and does not look for updates. To move to a new release, name the version, as in npx -y longterm-memory-mcp@1.6.0, or use @latest, which checks the registry on every start.
Or install globally
npm install -g longterm-memory-mcp
longterm-memory-mcp
Or from source
git clone https://github.com/MarcelRoozekrans/LongtermMemory-MCP.git
cd LongtermMemory-MCP npm install && npm run build npm start
Configuration
Claude Code
If you installed via the plugin marketplace, the MCP server is already configured. For manual setup, add to your MCP settings (~/.claude/settings.json or project .claude/settings.json):
{
"mcpServers": { "longterm-memory": { "command": "npx", "args": ["-y", "longterm-memory-mcp"] } } }
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": { "longterm-memory": { "command": "npx", "args": ["-y", "longterm-memory-mcp"] } } }
Agent Instructions
The repo includes agent instructions that teach AI agents how to use memory effectively (automatic recall, save patterns, deduplication):
| File | Purpose |
|---|---|
skills/long-term-memory/SKILL.md | Self-contained skill — auto-loaded by Claude Code plugin, can be referenced from any MCP client |
Database Location
By default, memories are stored in a shared, user-scoped location:
~/.longterm-memory-mcp/memories.db
This means every project and every MCP client shares the same memory pool — you save a memory in one project and it's available everywhere.
Several sessions can use the same database at once. Each server process reads and writes the shared file directly (SQLite in WAL mode), so a memory saved in one session is visible to every other session right away, and no session overwrites what another saved. Requires Node.js 22.13 or later.
Databases from older releases open unchanged. A database from v1.0–1.3, which has no schema_meta table, is migrated in place with all its memories kept; a copy named memories.db.pre-migration- .bak is written next to it first.
Upgrading from 1.4 or earlier: stop every running session that uses the old version before starting one with the new version. Older releases keep the whole database in memory and rewrite the file on each save, so an old process left running would overwrite what new sessions saved.
Per-project database
To isolate memories for a specific project, set the MEMORY_DB_PATH environment variable:
{
"mcpServers": { "longterm-memory": { "command": "npx", "args": ["-y", "longterm-memory-mcp"], "env": { "MEMORY_DB_PATH": "/path/to/project/memories.db" } } } }
Memory Types
Each memory has a memory_type that determines how it's categorized and how quickly it decays:
| Type | Description | Decay half-life |
|---|---|---|
general | Default catch-all | 60 days |
fact | Verified information | 120 days |
preference | User/project preferences | 90 days |
conversation | Conversation context | 45 days |
task | Task-related notes | 30 days |
ephemeral | Short-lived context | 10 days |
Tags & Importance
- Tags: Categorize memories with string tags (e.g.
["auth", "backend"]). Search withsearch_by_tags. - Importance (1–10): Controls how resistant a memory is to decay. Default is 5. Higher importance decays more slowly.
- Protected tags: Memories tagged with
core,identity, orpinnedskip decay entirely.
Decay & Reinforcement
Memories decay over time to keep the store relevant:
- Decay: Each memory type has a half-life (see table above). Importance decreases exponentially based on time since last access, with a floor that prevents full deletion.
- Reinforcement: Every time a memory is accessed via search, its importance increases by +0.1 (up to a max of 10). Frequently accessed memories stay important.
- Lazy evaluation: Decay is calculated on access, not on a timer — no background processes needed.
Content Deduplication
Memory content is hashed (SHA-256) on save. If identical content already exists, the save is rejected with a reference to the existing memory ID. This prevents duplicate entries automatically.
Content Guard
Memories end up in the database and in its JSON backups, so content is filtered before it is stored:
- ` ` spans are removed. Text inside
…is never stored, embedded or hashed. An unclosedremoves everything after it. Content that is empty once the spans are removed is rejected. - Secrets are rejected.
save_memoryandupdate_memoryrefuse content, metadata values and tags that look like a secret. The error names the pattern that matched and never the value.
| Pattern | Matches |
|---|---|
private-key | PEM / OpenSSH / PGP private key headers (certificates are allowed) |
github-token | ghp_, gho_, ghu_, ghs_, ghr_ and github_pat_ tokens |
api-key | sk-… style API keys |
aws-access-key | AKIA… / ASIA… access key ids |
jwt | JSON Web Tokens |
slack-token | xoxb-, xoxp- and similar Slack tokens |
secret-assignment | random-looking values after password=, token:, secret=, api_key=, KEY= and similar. References ($VAR, ${{ … }}), placeholders (<…>), calls and plain words are allowed |
Configure it with environment variables:
{
"mcpServers": { "longterm-memory": { "command": "npx", "args": ["longterm-memory-mcp"], "env": { "MEMORY_GUARD_DISABLE": "jwt,slack-token", "MEMORY_GUARD_EXTRA_PATTERNS": "{\"internal-host\": \"\\\\b[a-z0-9-]+\\\\.corp\\\\.example\\\\b\"}" } } } }
MEMORY_GUARD_DISABLE: a comma-separated list of pattern names to turn off, orallfor every built-in pattern.spans are removed either way. An unknown name stops the server at startup.MEMORY_GUARD_EXTRA_PATTERNS: a JSON object of extra patterns to reject, as name → regular expression.
The guard applies to new saves and updates only. Memories stored before it existed are not rescanned.
Automatic Recall
The Claude Code plugin ships a UserPromptSubmit hook that recalls memories without the agent having to ask. On the first prompt of each session it searches with the prompt text and adds the best matches to the context as a short list:
Long-term memories that may be relevant (longterm-memory; search_memory gives the full text):
- [2026-10-22 fact] pkill -f also matches the agent's own shell … (id 31ece450-…)
- Once per session: the hook keeps a marker file per session id in
recall-sessions/next to the database. Later prompts in that session cost onenodestart, about 30 ms, and no search. - Project: the hook takes the project name from the session's working directory. A memory that names the project in its content, tags or metadata ranks a little higher. The name is not part of the search text: a short prompt would then match on the project name alone.
- Cheap when it misses: nothing is injected when no memory reaches the threshold, and the block never exceeds the token cap.
- Content guard: a stored memory that the guard rejects, such as one saved before the guard existed, is never injected.
- Never blocks a prompt: errors go to stderr and the prompt continues.
- Pinned version: the hook runs
npx longterm-memory-mcp@ recall --hook, so a cached older copy is never used. The plugin's MCP server is pinned the same way.
Configure it with environment variables in your Claude Code settings (env in ~/.claude/settings.json). The hook runs in Claude Code's environment, not the MCP server's, so a custom MEMORY_DB_PATH has to be set there too.
| Variable | Default | Meaning |
|---|---|---|
MEMORY_RECALL_ENABLED | true | false turns the hook off |
MEMORY_RECALL_K | 5 | at most this many memories (1–50) |
MEMORY_RECALL_THRESHOLD | 0.5 | minimum cosine similarity (-1 to 1) |
MEMORY_RECALL_MAX_TOKENS | 400 | cap on the injected block, estimated at 4 characters per token |
MEMORY_RECALL_STATE_DIR | /recall-sessions | where the once-per-session markers live; markers older than 30 days are removed |
Recall CLI
The hook calls the recall subcommand, which also works on its own:
npx longterm-memory-mcp recall "how do we deploy the stack"
npx longterm-memory-mcp recall --k 3 --threshold 0.4 --project docker "deploy"
It prints the same list the hook injects, or No relevant memories found. on stderr. Options: --k, --threshold, --max-tokens and --project (default: the current directory's name, "" for none). It does not create a database that does not exist yet. With --hook it reads a Claude Code UserPromptSubmit event from stdin and answers with additionalContext.
Backups
Backups are managed automatically and can also be triggered manually via the create_backup tool.