local-memory-mcp
Description: Persistent local memory for Claude, Cursor and Codex. 13 MCP tools, SQLite + FTS5 + Knowledge Graph. No cloud, no API keys. One command: npx @studiomeyer/local-memory-mcp.
README
local-memory-mcp
Persistent local memory for Claude, Cursor & Codex. 13 tools. No cloud. No API keys.
Your AI assistant forgets everything when you close the chat. This fixes that.
Learnings, decisions, people, projects -- stored in a single SQLite file on your machine that never leaves your computer. Built-in Knowledge Graph, duplicate detection, and full-text search.
Quick Start
Claude Code
claude mcp add memory -- npx -y @studiomeyer/local-memory-mcp
Claude Desktop
Add to claude_desktop_config.json (Settings > Developer > Edit Config):
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@studiomeyer/local-memory-mcp"]
}
}
}
Cursor / VS Code
Add to .cursor/mcp.json or .vscode/mcp.json:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@studiomeyer/local-memory-mcp"]
}
}
}
Codex
# ~/.codex/config.toml
[mcp_servers.memory]
command = "npx"
args = ["-y", "@studiomeyer/local-memory-mcp"]
Automatic session tracking
You can make session tracking fully automatic so you never have to think about it.
Claude Code (CLAUDE.md): Add this line to your project's CLAUDE.md:
Always call memory_session_start at the beginning of each conversation and memory_session_end when done.
Claude Code (Hook): For a system-wide setup, add a SessionStart hook in ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [{
"hooks": [{
"type": "command",
"command": "echo '{\"hookSpecificOutput\":{\"additionalContext\":\"Call memory_session_start now.\"}}'",
"timeout": 5
}]
}]
}
}
Both approaches make Claude call memory_session_start automatically. The CLAUDE.md way is simpler, the hook way works across all projects.
What it does
When you start a conversation, the server loads context from your last sessions so the AI knows what you were working on.
During the conversation, the AI stores patterns, insights, and mistakes via memory_learn. It records facts about people, projects, and tools via memory_entity_observe -- building a knowledge graph over time.
When you search, FTS5 full-text search with bm25 ranking finds relevant memories instantly. The duplicate gatekeeper prevents storing the same information twice.
Tools (13)
Sessions
memory_session_start -- Call this first in every conversation. Loads context from your last 3 sessions (summaries, recent learnings) so your AI knows what you were working on. Optional project parameter to scope sessions by project.
memory_session_end -- Call at the end to save a summary. Pass a summary string describing what was accomplished. The next session auto-loads this. Without arguments it closes the active session.
Learnings
memory_learn -- The core tool. Stores a piece of knowledge with a category and content. Categories: pattern (recurring success), mistake (what went wrong), insight (strategic realization), research (external knowledge), architecture, infrastructure, tool, workflow, performance, security. The duplicate gatekeeper checks if something similar already exists. If it finds a match, it bumps the usage counter instead of creating a duplicate. Optional: tags, confidence (0-1), project, memoryType (episodic or semantic, auto-classified if omitted).
memory_recall -- Quick search on learnings only. Pass a query string for keyword search, or omit it to get the most recent learnings. Good for "what did I learn about X" questions. Use limit to control how many results come back (default 10).
memory_search -- Unified search across everything: learnings, decisions, entities, and observations. Uses FTS5 with bm25 ranking. Multi-word queries match any of the words and rank by relevance. Use types array to filter (e.g. ["learning", "decision"]). This is the broadest search tool.
When to use recall vs search: Use recall when you want learnings specifically. Use search when you want to find anything across all types, including entities and decisions.
Decisions
memory_decide -- Records a decision with structured context. Parameters: title (what was decided), decision (the choice made), reasoning (why), alternatives (what else was considered). Optional: confidence, project, tags. This is useful for looking back at past decisions months later and understanding why you chose something.
Knowledge Graph
memory_entity_observe -- Record a fact about a person, project, company, tool, or any other entity. If the entity does not exist yet it gets created automatically. Parameters: entityName, entityType (person, project, company, tool, concept, etc.), content (the fact). Observations are bi-temporal, meaning they can be superseded over time without losing history.
memory_entity_search -- Fuzzy search across entity names and their observations. Finds "Claude" even if you search for "claude ai". Optional entityType filter to narrow results.
memory_entity_open -- Load a full entity view: the entity itself, all its current observations, and all its relations to other entities. Search by name or id. This is the deep-dive tool when you want everything about one entity.
memory_entity_relate -- Create a typed, directed edge between two entities. Parameters: fromEntityId, toEntityId, relationType (e.g. "works_at", "uses", "created", "depends_on"). Optional weight (0-1). Build a graph of how things connect.
Recommended entity types: person, project, company, tool, concept, service, team. Use whatever makes sense for your domain.
Reflection
memory_insights -- Overview stats: how many days of memory, total sessions, learnings, decisions, entities. Category breakdown and entity type breakdown. Good for "what does Claude know about me" moments. Optional project filter.
memory_profile -- Store personal info locally. Use set to store fields (name, role, preferences, language, timezone), use get to retrieve them. Your AI can read this at session start to personalize its behavior.
memory_guide -- Built-in help. Topics: quickstart (how to get started), session (session workflow), search (how search works), entities (knowledge graph explained), learn (learning categories), privacy (where data lives, what is collected).
Tips
- Start with sessions and learnings. Just calling
memory_session_startat the beginning andmemory_learnwhen something important comes up already gives you 80% of the value. - Use entities for people and projects. When you mention a colleague, client, or project repeatedly, create an entity. Over time you build a knowledge graph that your AI can traverse.
- Decisions are underrated. Three months from now you will not remember why you chose Postgres over SQLite for that project.
memory_decidecaptures the reasoning. - Let your AI drive. Once the tools are available, your AI will naturally start using them. You do not need to call tools manually. Say "remember this" and it calls
memory_learn. Say "what do you know about Sarah" and it callsmemory_entity_search. - Back up your SQLite file. It is a single file. Copy it to a USB drive, Dropbox, wherever. You can also open it with any SQLite browser to inspect what your AI has learned.
Features
- Knowledge Graph -- not just flat text. Entities, bi-temporal observations, typed relations.
- Duplicate Guard -- FTS5 similarity check prevents storing the same thing twice. Usage counter instead.
- Session Context -- auto-loads last 3 sessions on start. Your AI picks up where you left off.
- Decision Tracking -- log decisions with reasoning and alternatives. Unique among memory servers.
- Full-Text Search -- FTS5 with bm25 ranking across learnings, decisions, entities, observations.
- Single SQLite File -- one file, portable, backupable, deletable. WAL mode for concurrent access.
- Zero Config --
npxand done. No Docker, no Postgres, no Redis, no API keys.
Where your data lives
Everything in one SQLite file. Back it up, move it, delete it -- it's yours.
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/local-memory-mcp/memory.sqlite |
| Linux | ~/.local/share/local-memory-mcp/memory.sqlite |
| Windows | %APPDATA%\local-memory-mcp\memory.sqlite |
Override: MEMORY_DB_PATH=/your/preferred/path.sqlite
Privacy
- Your data never leaves your machine
- No telemetry, no phone-home, no analytics
- No account required, no API keys needed
- Open source -- read every line of code
Comparison
| Feature | local-memory-mcp | Official MCP Memory | MemPalace | Mem0 | Zep |
|---|---|---|---|---|---|
| Local-first | Yes | Yes | Yes | No (cloud) | No (cloud) |
| Knowledge Graph | Yes (entities + relations) | Yes (triples) | No | Paid tier | No |
| Duplicate Guard | Yes (FTS5 similarity) | No | No | Unknown | Unknown |
| Decision Tracking | Yes | No | No | No | No |
| Session Context | Yes (auto-load) | No | No | No | No |
| Full-Text Search | FTS5 + bm25 | No | No (vector only) | Vector | Vector |
| Tools | 13 | 5 | 29 | API | API |
| Language | TypeScript | TypeScript | Python | Python | Python |
| Storage | SQLite | JSON file | ChromaDB | Cloud | Cloud |
| Install | npx |
npx |
pip + venv |
Sign up | Sign up |
| Price | Free forever | Free | Free | $0-249/mo | $0-499/mo |
local-memory-mcp vs. StudioMeyer Memory
Two products, same team, different use cases:
| local-memory-mcp (this repo) | StudioMeyer Memory (hosted) | |
|---|---|---|
| Where | Your machine (SQLite) | Cloud (Supabase EU Frankfurt) |
| Tools | 13 | 53 |
| Search | FTS5 keyword | FTS5 + pgvector semantic + reranking |
| Multi-device | No | Yes |
| Multi-agent | No | Yes |
| Price | Free forever | Free tier / $29 Pro / $49 Team |
| Install | npx |
memory.studiomeyer.io |
| Repo | local-memory-mcp | studiomeyer-memory (docs) |
Start local. Upgrade when you need teams or semantic search.
Also by StudioMeyer
| Server | What it does | Link |
|---|---|---|
| StudioMeyer Memory | Hosted AI memory with 53 tools, semantic search, multi-agent | memory.studiomeyer.io |
| StudioMeyer CRM | AI-native CRM -- 33 tools, pipeline, leads, revenue | crm.studiomeyer.io |
| StudioMeyer GEO | AI visibility monitoring -- 23 tools, 8 LLM platforms | geo.studiomeyer.io |
| MCP Crew | Agent personas for Claude -- 10 tools, 8 roles, 3 workflows | crew.studiomeyer.io |
Contributing
Issues and PRs welcome. See CONTRIBUTING.md.
License
Built by StudioMeyer -- AI-first web studio from Mallorca.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。