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:
Potencia tu agente
El comando propio del publicador. No es un endpoint de PlugMCP.
Host a copy with our keys and logs.
npx -y [email protected]Claude Code no tiene enlace de instalación para un comando local. Copia el comando de abajo y ejecútalo en una terminal.
claude mcp add io.github.marcelroozekrans-longterm-memory -- npx -y longterm-memory-mcp@1.6.1Ejecútalo en una terminal.
{ "mcpServers": { "io.github.marcelroozekrans-longterm-memory": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
¿URL remota o un comando en tu máquina? En qué se diferencian las dos instalaciones
Ejecutar en PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirDel publicador
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:
A fully local MCP server for long-term memory with semantic search
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:
long-term-memory skill (Claude learns to recall context at session start, save insights after tasks, and deduplicate memories)npx longterm-memory-mcp
npm install -g longterm-memory-mcp
longterm-memory-mcp
git clone https://github.com/MarcelRoozekrans/LongtermMemory-MCP.git
cd LongtermMemory-MCP
npm install && npm run build
npm start
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"]
}
}
}
Add to claude_desktop_config.json:
{
"mcpServers": {
"longterm-memory": {
"command": "npx",
"args": ["-y", "longterm-memory-mcp"]
}
}
}
The repo includes agent instructions that teach AI agents how to use memory effectively (automatic recall, save patterns, deduplication):
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-<timestamp>.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.
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"
}
}
}
}
Each memory has a memory_type that determines how it's categorized and how quickly it decays:
["auth", "backend"]). Search with search_by_tags.core, identity, or pinned skip decay entirely.Memories decay over time to keep the store relevant:
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.
Backups are managed automatically and can also be triggered manually via the create_backup tool.
~/.longterm-memory-mcp/backups/ by default, or set MEMORY_BACKUP_PATH:{
"mcpServers": {
"longterm-memory": {
"command": "npx",
"args": ["-y", "longterm-memory-mcp"],
"env": {
"MEMORY_BACKUP_PATH": "/path/to/backups"
}
}
}
}
all-MiniLM-L6-v2 (384-dim vectors) and stored in SQLite alongside the raw content, metadata, tags, importance, and type. Content is deduplicated via SHA-256 hash.The embedding model (~30MB quantized) is downloaded once on first use and cached locally.
src/ — MCP server source
index.ts — Entry point (stdio transport, DB/backup path resolution)
server.ts — MCP server factory + 11 tool definitions
memory-store.ts — SQLite storage + vector search + decay integration
embeddings.ts — Local embedding engine (Xenova/transformers)
decay.ts — DecayEngine (lazy decay, reinforcement, protected tags)
backup.ts — BackupManager (auto-backup, JSON export, pruning)
types.ts — TypeScript interfaces (Memory, Embedder, config types)
skills/ — Claude Code plugin skill
long-term-memory/SKILL.md — Self-contained agent instructions + skill
.claude-plugin/ — Plugin & marketplace metadata
plugin.json — Plugin manifest
marketplace.json — Marketplace manifest
.mcp.json — Auto-configures MCP server on plugin install
.vscode/mcp.json — VS Code MCP server config
Run with npm run bench. Results from an in-memory store using mock embeddings (isolates store/SQLite performance from model latency):
npm install # Install dependencies
npm run build # Compile TypeScript
npm test # Run all tests
npm run bench # Run benchmarks
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
This project uses Conventional Commits and semantic-release for automated versioning.
<type>(<optional scope>): <description>
[optional body]
[optional footer(s)]
Breaking changes: Add ! after the type (e.g., feat!: remove deprecated API) or include a BREAKING CHANGE: footer. This triggers a major version bump.
git commit -m "feat: add memory tagging support"
git commit -m "fix: handle empty search query gracefully"
git commit -m "feat!: change default database location"
git commit -m "docs: update configuration examples"
Commit messages are validated locally via commitlint + husky git hooks. Non-conforming messages will be rejected.
Releases are fully automated. When commits are pushed to main:
CHANGELOG.mdNo manual version bumps or tags needed.
Dependencies are managed automatically by Renovate. Patch and minor devDependency updates are auto-merged after CI passes. Major updates create PRs for manual review.
MIT
A fully local MCP server for long-term memory with semantic search
{ "mcpServers": { "io.github.marcelroozekrans-longterm-memory": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}Herramientas
Aún no hay lista de herramientas. Los servidores remotos la reciben tras la primera comprobación de estado.
Preguntas frecuentes
Copia en esta página la configuración stdio para Cursor, Claude Desktop, Claude Code o VS Code. Usa la instalación del publicador, no un proxy de PlugMCP.
Este registro no indica ninguna variable de entorno obligatoria.
Longterm Memory se ejecuta localmente por stdio.
Última comprobación: 2026-11-09. A fully local MCP server for long-term memory with semantic search