Claude Memory MCP Server
Click on "Install 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., "@Claude Memory MCP Serverremember my favorite color is blue"
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.
Claude Memory MCP Server
Enterprise-grade MCP server for persistent, intelligent memory management across Claude Code sessions.
Overview
Claude Memory is an MCP server that provides persistent memory capabilities with enterprise features: concurrent multi-writer access, intelligent search, versioning, backup/restore, and more. Designed for teams and individuals who need reliable, scalable memory management.
Features
Core Capabilities
Persistent Memory - Store and recall memories across sessions
Semantic Search - TF-IDF powered similarity search
Multi-Scope - User, project, and session-specific memories
Auto-Tagging - Intelligent tag inference from content
Importance Scoring - Automatic relevance weighting (1-10)
Enterprise Features
Concurrent Access - File locking for multi-writer scenarios
Versioning - Full memory version history
Transaction Support - Atomic batch operations
Append-Only Logging - Crash recovery audit trail
Backup/Restore - Point-in-time recovery
Memory Consolidation - Deduplication and merge
GC - Automatic expired memory cleanup
Installation
Quick Start (npm)
npm install @gsxrchris/claude-memoryConfigure in .mcp.json (project or global at ~/.claude/):
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["@gsxrchris/claude-memory"]
}
}
}Running Without npm
For local development:
npx tsx src/index.tsMCP Tools (22 Tools)
Core Memory Operations
Tool | Description |
| Store memory with auto-importance, tags, expiration |
| Search with semantic/exact/hybrid, filters, cross-project |
| Find similar memories using vector search |
| Load memories sorted by importance |
| Save session context with summarization |
| List memories with metadata |
| Clear memories for a scope |
Intelligence
Tool | Description |
| Find and merge similar memories |
| Expand queries with synonyms |
Transactions (Enterprise)
Tool | Description |
| Start atomic batch operation |
| Commit all pending changes |
| Rollback all pending changes |
Versioning & Audit
Tool | Description |
| Get memory version history |
| Restore specific version |
| Query operation history |
Backup & Recovery
Tool | Description |
| Create point-in-time backup |
| List available backups |
| Restore from backup |
| Delete backup |
Maintenance
Tool | Description |
| Clean expired memories |
| Force search index rebuild |
| Periodic save reminders |
Skills & Profile
Tool | Description |
| Create Claude Code skill |
| List created skills |
| Get learned user preferences |
| Update user profile |
Search Modes
Mode | Description |
| TF-IDF similarity via vector index |
| Plain text substring match |
| Combined scoring (recommended) |
Scopes
Scope | Location | Usage |
|
| Persistent across projects |
|
| Project-specific |
|
| Temporary (7 day TTL) |
| Cross-project | Federated search |
Memory Schema
Memories are stored as markdown with YAML frontmatter:
---
scope: user
type: preference
created: 2025-05-22T10:00:00Z
modified: 2025-05-22T12:00:00Z
version: 2
importance: 8
tags: [language, typescript, enterprise]
expires-at: 2025-05-29T10:00:00Z
project-id: myproject
user-id: user@company.com
---
Your memory content here...Configuration
Environment Variables
Variable | Description | Default |
| Custom memory storage path (for team shared storage) |
|
| Lock acquisition timeout (ms) | 5000 |
| Log rotation threshold (bytes) | 100MB |
| Max versions per memory | 3 |
Or via Settings
Add to your Claude Code settings:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["@gsxrchris/claude-memory"]
}
}
}Team/Shared Deployment
For teams sharing a memory store:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["@gsxrchris/claude-memory"],
"env": {
"MEMORY_DATA_DIR": "//server/share/memories"
}
}
}
}Architecture
┌─────────────────────────────────────────────┐
│ MCP Server Layer │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Tools │ │ Request │ │Response │ │
│ │ Router │ │ Validator│ │Formatter │ │
│ └──────────┘ └──────────┘ └──────────┘ │
├─────────────────────────────────────────────┤
│ Core Services Layer │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Memory │ │ Search │ │ Session │ │
│ │ Service │ │ Engine │ │ Manager │ │
│ └──────────┘ └──────────┘ └──────────┘ │
├─────────────────────────────────────────────┤
│ Persistence Layer │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ FileMgr │ │ Vector │ │ Log │ │
│ │ +Lock │ │ Index │ │ Manager │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────┘Concurrency
The server supports concurrent multi-writer access through:
File-level locking - Exclusive (write) and shared (read) locks
Atomic writes - Temp-file-then-rename pattern
Append-only log - Crash recovery via replay
Backup Strategy
Backups include:
All memory files (
.memories/)Transaction log (
memory.log)Vector index (
.index/)User profile
Security
Memories stored locally (no cloud)
No encryption (plaintext)
User-specific isolation via filesystem permissions
Migration from v1.x
The server is a drop-in replacement. All v1.x tools work unchanged.
New users: Memory directory is created automatically at first use.
Development
# Clone
git clone https://github.com/gsxrchris/claude-memory.git
cd claude-memory
# Install
npm install
# Build
npm run build
# Test
npm test
# Run
npm startLicense
MIT - See LICENSE file
Author
Developed by Chris Bunting cbuntingde@gmail.com
Support
Changelog: See RELEASE-NOTES.md
Hooks (Automation)
This package includes hooks for automatic memory capture. Add to your Claude Code settings.json using the official hook format:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|NotebookEdit",
"hooks": [
{
"type": "command",
"command": "npx @gsxrchris/claude-memory hooks tool"
}
]
}
],
"PreToolUse": [
{
"matcher": "Bash|PowerShell",
"hooks": [
{
"type": "command",
"command": "npx @gsxrchris/claude-memory hooks pre-tool"
}
]
}
]
}
}Available Hooks
Hook | Purpose | Event |
| Capture Edit/Write/Bash usage | PostToolUse |
| Show conventions before Bash | PreToolUse |
| Capture user requests | PostUserPromptSubmit |
NPM Hook Commands
# Capture tool use
npx @gsxrchris/claude-memory hooks tool
# Pre-tool suggestions
npx @gsxrchris/claude-memory hooks pre-tool
# Capture prompt
npx @gsxrchris/claude-memory hooks promptCLI Commands
# Recall memories
npx @gsxrchris/claude-memory cli recall --scope user --limit 5
# Remember something
npx @gsxrchris/claude-memory cli remember --content "remember this" --scope user
# List memories
npx @gsxrchris/claude-memory cli list --scope user
# Clear session memories
npx @gsxrchris/claude-memory cli clear --scope session
# Garbage collect expired
npx @gsxrchris/claude-memory cli gcSee HOOKS.md for full details.
This server cannot be installed
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cbuntingde/claude-memory'
If you have feedback or need assistance with the MCP directory API, please join our Discord server