mcp-memvid
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-memvid auto-resume my last session"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-Memvid with LCM
MCP Server for Memvid - 给 Claude Code 提供长期记忆和无损上下文管理功能。
✨ 特性
LCM (Lossless Context Management)
自动压缩: 对话超过阈值时自动摘要旧消息
完全集成: 所有数据存储在单个 Memvid
.mv2文件中持久化: 消息、摘要、记忆都在 Memvid 中,不会丢失
智能搜索: 统一搜索所有历史对话和记忆
长期记忆
跨会话记忆: 在不同 Claude Code 窗口间共享记忆
语义搜索: 使用自然语言查找相关记忆
分类管理: 按项目、偏好、决策、模式等分类存储
基于 LCM 论文 和 lossless-claw 项目。
Related MCP server: Central Brain
🚀 快速安装
git clone https://github.com/stflj2022/mcp-memvid.git
cd mcp-memvid
npm install
npm run build
chmod +x install.sh
./install.sh⚙️ 配置
将以下内容添加到 ~/.claude.json 的 mcpServers 部分:
{
"mcpServers": {
"memvid": {
"type": "stdio",
"command": "node",
"args": ["$HOME/.claude/mcp-memvid/dist/index.js"]
}
}
}🛠️ 工具
LCM 工具
工具 | 描述 |
| 查看上下文状态和压缩建议 |
| 执行上下文压缩 |
| 列出所有摘要 |
| 在消息和摘要中搜索 |
记忆工具
工具 | 描述 |
| 自动恢复上次中断的对话 |
| 保存当前对话上下文 |
| 存储长期记忆 |
| 搜索长期记忆 |
| 获取记忆摘要 |
📖 使用示例
查看上下文状态
lcm_status()输出:
📊 LCM 状态
📝 当前消息: 150 条
🔤 估算 tokens: 180,000
📦 已创建摘要: 3 个
🎯 压缩阈值: 150,000 (75%)
⚠️ 建议执行压缩
可压缩约 86 条消息
运行: lcm_compact()执行压缩
lcm_compact()搜索历史
lcm_search(query="dice-memonic bug")自动恢复(中断后继续)
memvid_auto_resume()存储长期记忆
memvid_store(content="用户偏好简洁回答", category="preference", importance=7)💡 数据架构
┌─────────────────────────────────────────┐
│ ~/.claude-memories/ │
│ │
│ ┌───────────────────────────────────┐ │
│ │ claude-memories.mv2 │ │
│ │ (Memvid Database) │ │
│ │ │ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ Messages (type:message) │ │ │
│ │ │ - role, content, timestamp │ │ │
│ │ │ - compressed flag │ │ │
│ │ └─────────────────────────────┘ │ │
│ │ │ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ Summaries (type:summary) │ │ │
│ │ │ - content, sourceIds │ │ │
│ │ │ - depth, topics │ │ │
│ │ └─────────────────────────────┘ │ │
│ │ │ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ Memories (type:memory) │ │ │
│ │ │ - content, category │ │ │
│ │ │ - tags, importance │ │ │
│ │ └─────────────────────────────┘ │ │
│ │ │ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ Context Snapshots │ │ │
│ │ └─────────────────────────────┘ │ │
│ │ │ │
│ └───────────────────────────────────┘ │
│ │
│ context-cache.json (仅用于快速启动缓存) │
└─────────────────────────────────────────┘🎯 解决的问题
问题 | 解决方案 |
上下文超限中断 | LCM 自动压缩,延长单次会话 |
中断后无法继续 |
|
旧对话丢失 | 所有内容保存在 Memvid,可搜索 |
跨会话记忆 | Memvid 长期存储 + 语义搜索 |
数据分散 | 单一 |
📂 数据位置
~/.claude-memories/
├── claude-memories.mv2 # 所有数据(消息、摘要、记忆)
└── context-cache.json # 启动缓存(可删除,会重建)📄 License
MIT
Available Tools
10 toolslcm_compactD
[LCM] 执行上下文压缩
Inputs: force.
lcm_list_summariesB
[LCM] 列出所有摘要节点
Inputs: no named parameters.
lcm_searchC
[LCM] 在消息和摘要中搜索
Inputs: query (required).
lcm_statusC
[LCM] 查看当前上下文状态
Inputs: maxTokens.
memvid_auto_resumeB
[AUTO] 检查并恢复之前中断的对话上下文
Inputs: no named parameters.
memvid_quick_saveB
[AUTO] 快速保存当前对话上下文(自动生成摘要)
Inputs: no named parameters.
memvid_save_contextA
保存当前对话上下文(用于意外中断后恢复)
Inputs: summary (required), topics, projects.
memvid_searchC
搜索长期记忆
Inputs: query (required), limit.
memvid_storeA
存储一条长期记忆(如用户偏好、项目信息、技术决策等)
Inputs: content (required), tags, category, importance.
memvid_summaryB
获取记忆和上下文摘要
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Several tools overlap in purpose: lcm_search and memvid_search both search, lcm_list_summaries and memvid_summary both surface summaries, and lcm_status overlaps with memvid_summary. The LCM/AUTO tags hint at subsystems but do not clearly separate responsibilities.
The toolset mixes lcm_ and memvid_ prefixes with inconsistent naming styles: some are noun-like (lcm_status, memvid_summary), others are verb phrases (memvid_save_context, memvid_quick_save), and search appears in both namespaces. There is no predictable verb_noun pattern across the full set.
Ten tools is a reasonable size for a context/memory management server, and the count is not excessive. However, the effective surface feels slightly larger than necessary because some tools are near-duplicates of each other.
The set covers saving, restoring, compacting, summarizing, and searching context and memory, but long-term memory has no update/delete/forget capabilities. There is also no clear way to explicitly manage or clear stored memories beyond storing and searching.
Maintenance
Related MCP Connectors
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Shared work memory for Claude Code, Codex, Cursor and chat, scoped to each repository.
Persistent cross-session memory shared by Codex, Claude Code, ChatGPT, and other AI agents.
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenancePersistent memory for Claude Code — a self-evolving knowledge layer that survives across sessions, grows from every conversation, and surfaces relevant context automatically.14MIT
- AlicenseNot gradedqualityDmaintenanceProvides persistent memory for Claude Code, automatically extracting and surfacing relevant context from past sessions to avoid re-explaining issues and decisions.MIT
- AlicenseAqualityDmaintenancePersistent memory + intelligent context for Claude Code. Save and reuse solutions, decisions, and patterns across projects.437MIT
- AlicenseNot gradedqualityBmaintenanceProvides persistent long-term memory for Claude Code by enabling semantic save, search, and context retrieval across sessions.1MIT