memory-mcp
The memory-mcp server provides a persistent memory service for Claude Code, enabling automatic saving, recall, and semantic search of conversation context, decisions, preferences, and knowledge entities across sessions.
Episode Management
Start, close, and archive conversation sessions (episodes) with tags and auto-generated summaries
Get the currently active episode, list all historical episodes, or retrieve full details (messages + linked entities) of a specific episode
Knowledge Entity Management
Add, confirm, reject, or deprecate knowledge entities of types:
Decision,Preference,Concept,Habit,File, orArchitectureList pending auto-detected entity candidates awaiting review
Memory Retrieval & Search
Semantic search across all stored episodes and entities using natural language queries
Filter entity searches by type (e.g., all Decisions or Preferences)
Message Caching
Manually cache user or assistant messages (with automatic entity detection)
Clear the entire cache or clean up messages older than a specified number of days
System & Status
Retrieve system statistics (episodes, entities, etc.) and check vector encoder status
Automatic Context Management When configured with Claude Code hooks, it automatically saves messages, recalls relevant memories, and injects context into ongoing conversations.
Dual-Layer Storage Supports both user-level (shared across projects) and project-level (isolated per project) memory storage.
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., "@memory-mcp recall what we discussed about authentication"
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.
Memory MCP Service
A persistent memory MCP service for Claude Code. Automatically saves conversations and retrieves relevant history across sessions.
What it does: Every time you chat with Claude Code, your conversation context (decisions, preferences, key discussions) is saved and automatically recalled in future sessions — so Claude always has the background it needs.

Quick Start
Prerequisites
Install uv (Python package runner):
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Mac/Linux
curl -LsSf https://astral.sh/uv/install.sh | shRequires Python 3.10 - 3.13 (chromadb is not compatible with Python 3.14+).
1. Initialize (First Time Only)
Download the vector model (~400MB, one-time):
uvx --from chenxiaofie-memory-mcp memory-mcp-init2. Add MCP Server to Claude Code
claude mcp add memory-mcp -s user -- uvx --from chenxiaofie-memory-mcp memory-mcp3. Configure Hooks (Recommended)
Hooks enable fully automatic message saving. Without hooks, you need to manually call memory tools.
Add the following to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "uvx --from chenxiaofie-memory-mcp memory-mcp-session-start" }]
}],
"UserPromptSubmit": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "uvx --from chenxiaofie-memory-mcp memory-mcp-auto-save" }]
}],
"Stop": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "uvx --from chenxiaofie-memory-mcp memory-mcp-save-response" }]
}],
"SessionEnd": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "uvx --from chenxiaofie-memory-mcp memory-mcp-session-end" }]
}]
}
}4. Verify
claude mcp listYou should see memory-mcp: ... - ✓ Connected.
That's it! Start a new Claude Code session and your conversations will be automatically saved and recalled.
Related MCP server: claude-memory-mcp
How It Works
Session Start ──► Create Episode ──► Monitor Process (background)
│
User Message ──► Save Message ──► Recall Related Memories ──► Inject Context
│
Claude Reply ──► Save Response │
│
Session End ──► Close Signal ──► Archive Episode + Generate SummaryEpisodes: Each conversation session is an "episode" with auto-generated summaries
Entities: Key knowledge extracted from conversations (decisions, preferences, concepts)
Dual-layer storage: User-level (shared across projects) + Project-level (isolated per project)
Semantic search: Vector-based retrieval finds relevant past context
Usage
Automatic Mode (With Hooks)
Once hooks are configured, everything is automatic. Claude will see relevant history from past sessions as context.
Manual Mode
You can also call memory tools directly in Claude Code:
# Start a new episode
memory_start_episode("Login Feature Development", ["auth"])
# Record a decision
memory_add_entity("Decision", "Use JWT + Redis", "For distributed deployment")
# Search history
memory_recall("login implementation")
# Close episode
memory_close_episode("Completed JWT login feature")Hooks Reference
Hook | What it does | Timing |
SessionStart | Creates a new episode | ~50ms |
UserPromptSubmit | Saves user message + retrieves related memories | ~1-2s |
Stop | Saves assistant response | ~1s |
SessionEnd | Signals episode closure | ~50ms |
Tools Reference
Tool | Description |
| Start a new episode |
| Close and archive current episode |
| Get current active episode |
| Add a knowledge entity |
| Confirm a detected entity candidate |
| Reject a false detection |
| Mark an entity as outdated |
| List pending entity candidates |
| Semantic search across episodes and entities |
| Search entities by type |
| Get full episode details |
| List all episodes chronologically |
| Get system statistics |
| Check vector encoder status |
| Manually cache a message |
| Clear message cache |
| Clean up old cached messages |
Entity Types
Type | Level | Description |
| Project | Technical decisions for this project |
| Project | Architecture designs |
| Project | Important file descriptions |
| User | Personal preferences (shared across projects) |
| User | General concepts |
| User | Work habits |
Storage Locations
User-level:
~/.claude-memory/Project-level:
{project-root}/.claude/memory/
If you need to run from source (e.g., for development):
git clone https://github.com/chenxiaofie/memory-mcp.git
cd memory-mcp
# Windows:
install.bat
# Mac/Linux:
chmod +x install.sh && ./install.shThen configure MCP server with the venv Python:
# Windows:
claude mcp add memory-mcp -s user -- "C:\path\to\memory-mcp\venv310\Scripts\python.exe" -m memory_mcp.server
# Mac/Linux:
claude mcp add memory-mcp -s user -- /path/to/memory-mcp/venv310/bin/python -m memory_mcp.serverAuthor
陈佳俊 (Jiajun Chen) — front-end engineer based in Hangzhou, China. GitHub @chenxiaofie · feifeichen1999@gmail.com
本项目由陈佳俊(GitHub: chenxiaofie)开发并维护。
License
MIT License - see LICENSE file for details.
Available Tools
9 toolsmemory_clear_cacheA
清空消息缓存日志(message_cache.jsonl)。警告:此操作不可逆!
Inputs: confirm (required).
memory_deprecate_entityC
废弃一个过时的实体
Inputs: entity_id (required), superseded_by.
memory_encoder_statusA
查询向量编码器状态。返回编码器是否已就绪,以及哪些操作当前可用。
Inputs: no named parameters.
memory_get_episode_detailA
获取情景详情(包含消息和关联实体)
Inputs: episode_id (required).
memory_get_pendingB
获取所有待确认的实体候选
Inputs: no named parameters.
memory_recallA
综合检索记忆(情景+实体)。【重要】当用户询问'我是谁'、身份信息、个人偏好、历史决策、之前讨论过的内容时,应主动调用此工具检索相关记忆,而不是凭空回答。
Inputs: query (required), top_k, include_deprecated.
memory_reject_candidateB
拒绝一个误判的实体候选
Inputs: candidate_id (required).
memory_search_by_typeC
按类型检索实体
Inputs: entity_type (required), query, top_k.
memory_statsC
获取记忆系统统计信息
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 9 tools
各工具目标基本清晰:检索类、候选管理类、系统维护类之间的边界比较明显。不过 memory_recall 与 memory_search_by_type 都是检索入口,存在轻微功能重叠,但描述足以区分综合检索与按类型检索。
所有工具统一使用 memory_ 前缀且采用小写和下划线,整体命名风格一致。但 memory_stats 与 memory_encoder_status 是名词式命名,而大多数工具是动词加宾语形式,略有偏差。
9 个工具覆盖检索、候选管理、系统状态和缓存管理,数量处于 3-15 的合理区间,没有冗余的重复工具,范围适中。
检索和状态查询较完整,但候选实体管理只有获取待确认和拒绝,缺少确认/接受候选实体的操作,形成流程断点。此外没有显式的实体新增或编辑工具,生命周期覆盖不完整。
Maintenance
Related MCP Connectors
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Persistent memory for AI agents to retain, retrieve, and recall conversation context through MCP.
Cloud-hosted MCP server for durable AI memory
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives Claude persistent memory by storing conversation context, entities, and enabling semantic search across sessions.34 npm1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives Claude Code cross-session memory persisted to a plain .claude-memory.md file in your repo.MIT
- AlicenseNot gradedqualityDmaintenancePersistent memory MCP server for Claude Code that captures and recalls project context across sessions, eliminating the need to re-explain architecture and decisions daily.73 npm1MIT
- AlicenseNot gradedqualityCmaintenanceA persistent memory MCP server for Claude Code that enables long-term recall across sessions via hybrid search, code intelligence, and tools for reading/writing memory.20 npm5MIT