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:
Agenten stärken
Der eigene Befehl des Herausgebers. Kein PlugMCP-Endpunkt.
Host a copy with our keys and logs.
npx -y [email protected]Claude Code hat keinen Installationslink für einen lokalen Befehl. Kopieren Sie den Befehl unten und führen Sie ihn in einem Terminal aus.
claude mcp add io.github.marcelroozekrans-longterm-memory -- npx -y longterm-memory-mcp@1.6.1In einem Terminal ausführen.
{ "mcpServers": { "io.github.marcelroozekrans-longterm-memory": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
Remote-URL oder ein Befehl auf Ihrem Rechner? Worin sich die beiden Installationen unterscheiden
Auf PlugMCP ausführen
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.
StartenVom Herausgeber
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]" ] } }}Tools
Noch keine Tool-Liste. Remote-Server erhalten eine nach dem ersten Health-Check.
FAQ
Kopieren Sie auf dieser Seite die stdio-Konfiguration für Cursor, Claude Desktop, Claude Code oder VS Code. Sie nutzt die Installation des Herausgebers, keinen PlugMCP-Proxy.
In diesem Eintrag ist keine erforderliche Umgebungsvariable aufgeführt.
Longterm Memory läuft lokal über stdio.
Zuletzt geprüft: 2026-11-09. A fully local MCP server for long-term memory with semantic search