MemDrive
Shareable memory for AI coding agents. Enables agents to remember and recall durable memories across sessions and share them as importable packs.
README
MemDrive
Shareable memory for AI coding agents. Teach Claude Code (or Cursor) something once, then carry that knowledge across sessions — and hand it to a teammate as a single file they can import into their agent.
I taught Claude Code something on my laptop, exported a pack, my friend
imported it in Cursor, and their agent knew it.
MemDrive is a tiny MCP server + CLI. No
cloud, no account, no embeddings service — just a local SQLite database and
plain-text .jsonl packs you own.
Install
npx memdrive@latest install
This wires MemDrive into every agent it finds:
- Claude Code — adds the MCP server and (optionally) a Stop hook that auto-distills durable memories when a session ends.
- Cursor — adds the MCP server (you call
remember/recallyourself).
It backs up each config before touching it, never clobbers your other MCP servers, and prints exactly what changed. Then open your agent and ask: "what do you remember?"
Remove it any time:
npx memdrive@latest install --remove
The three tools
Your agent gets three tools it can call on its own:
| Tool | When it fires |
|---|---|
remember |
You decide something, state a rule/preference, or hit a gotcha and its fix. Stores a short, distilled memory — never a transcript. |
recall |
At the start of a task. Returns the most relevant memories, pinned first, inside labelled [MEMORY …] envelopes. |
forget |
A memory is wrong or outdated. Tombstones it by id. |
Memories have a type (decision, convention, gotcha, preference,
fact, snippet, todo_context), an optional project scope, and tags.
Sharing packs
Packs are the whole point. A pack is one .jsonl file — a header line plus one
memory per line.
# Export the acme project's memories (personal preferences are left out)
memdrive export acme.jsonl --project acme
# On another machine / in another agent
memdrive import acme.jsonl --name acme-team
- Idempotent. Every memory has a ULID, so re-importing an updated pack only adds the new entries. Share the file over GitHub or Drive and re-import whenever it changes — that's your sync story for v0.1.
- Secret-safe. Export scans for API keys, tokens, JWTs, connection strings,
and private keys, and refuses (naming each finding) unless you pass
--force. - Provenance kept. Imported memories are labelled
source=pack:<name>and are never auto-pinned into your context.
Other commands
memdrive list [--project x] [--all] # see what's stored
memdrive status # DB path + counts by type/source
memdrive serve # run the MCP server (your agent does this)
Everything lives in ~/.memdrive/local.db. Override with MEMDRIVE_DB for
scratch/testing.
Security note
Imported packs are untrusted text. A pack is just JSON someone else wrote —
read the .jsonl before importing it, exactly as you would a shell script from
the internet. MemDrive relabels provenance and refuses to pin imported memories,
but it cannot vouch for their content.
How it works
- Storage: SQLite with an FTS5 full-text index. Search is
bm25relevance, pinned-first, with a recency tiebreak; tombstoned and expired memories are never returned. - Server: stdio MCP.
recallrenders memories under a token budget so it never blows up your context. - Distill hook: on Claude Code session end, MemDrive tails the transcript
and asks a headless
claude -pto extract ≤5 durable memories as strict JSON, validates them, redacts secrets, and stores them withconfidence=0.6.
Roadmap
v0.1 is deliberately small. Next up, roughly in order:
- Embeddings (hybrid FTS + vector search) behind the same
recallcontract - Collections for grouping memories beyond
project/tags - Live mounts / sync and an HTTP transport
- Review queue for triaging imported packs
- More clients (Windsurf, Cline, VS Code)
The v0.1 interfaces — the store API, the recall contract, and the JSONL pack
format — were chosen to survive all of the above without a migration.
Develop
npm install
npm run build # tsup → dist/cli.js
npm test # vitest
npm run typecheck
MIT licensed.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。