The MCP Memory Service provides semantic memory and persistent storage capabilities for Claude Desktop using ChromaDB and sentence transformers. It enables long-term memory with semantic search, making it ideal for maintaining context across conversations.
# Clone the repository
git clone https://github.com/doobidoo/mcp-memory-service.git
cd mcp-memory-service
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Run the installation script
python install.py
The install.py
script will:
# Using Docker Compose (recommended)
docker-compose up
# Using Docker directly
docker build -t mcp-memory-service .
docker run -p 8000:8000 -v /path/to/data:/app/chroma_db -v /path/to/backups:/app/backups mcp-memory-service
Alternative Docker Compose configurations:
docker-compose -f docker-compose.uv.yml up
# After activating your virtual environment
python scripts/install_windows.py
npx -y @smithery/cli install @doobidoo/mcp-memory-service --client claude
Add the following to your claude_desktop_config.json
file:
{
"memory": {
"command": "uv",
"args": [
"--directory",
"your_mcp_memory_service_directory", // e.g., "C:\\REPOSITORIES\\mcp-memory-service"
"run",
"memory"
],
"env": {
"MCP_MEMORY_CHROMA_PATH": "your_chroma_db_path", // e.g., "C:\\Users\\John.Doe\\AppData\\Local\\mcp-memory\\chroma_db"
"MCP_MEMORY_BACKUPS_PATH": "your_backups_path" // e.g., "C:\\Users\\John.Doe\\AppData\\Local\\mcp-memory\\backups"
}
}
}
{
"memory": {
"command": "python",
"args": [
"C:\\path\\to\\mcp-memory-service\\memory_wrapper.py"
],
"env": {
"MCP_MEMORY_CHROMA_PATH": "C:\\Users\\YourUsername\\AppData\\Local\\mcp-memory\\chroma_db",
"MCP_MEMORY_BACKUPS_PATH": "C:\\Users\\YourUsername\\AppData\\Local\\mcp-memory\\backups"
}
}
}
The memory service is invoked through natural language commands in your conversations with Claude:
store_memory
- Store new information with optional tagsretrieve_memory
- Perform semantic search for relevant memoriesrecall_memory
- Retrieve memories using natural language time expressionssearch_by_tag
- Find memories using specific tagsexact_match_retrieve
- Find memories with exact content matchdebug_retrieve
- Retrieve memories with similarity scorescreate_backup
- Create database backupget_stats
- Get memory statisticsoptimize_db
- Optimize database performancecheck_database_health
- Get database health metricscheck_embedding_model
- Verify model statusdelete_memory
- Delete specific memory by hashdelete_by_tag
- Delete memories with specific tag(s) - supports both single tags and multiple tagsdelete_by_tags
- Explicitly delete memories containing any of the specified tags (OR logic)delete_by_all_tags
- Delete memories containing all specified tags (AND logic)cleanup_duplicates
- Remove duplicate entries// Store memories with tags
store_memory("Project deadline is May 15th", {tags: ["work", "deadlines", "important"]})
store_memory("Grocery list: milk, eggs, bread", {tags: ["personal", "shopping"]})
store_memory("Meeting notes from sprint planning", {tags: ["work", "meetings", "important"]})
// Search by multiple tags
search_by_tag(["work", "important"]) // Returns memories with either tag
// Enhanced deletion options
delete_by_tag("temporary") // Delete single tag
delete_by_tag(["temporary", "outdated"]) // Delete memories with any of these tags
delete_by_tags(["personal", "shopping"]) // Explicit multi-tag deletion
delete_by_all_tags(["work", "important"]) // Delete only memories with BOTH tags
Configure through environment variables:
CHROMA_DB_PATH: Path to ChromaDB storage
BACKUP_PATH: Path for backups
AUTO_BACKUP_INTERVAL: Backup interval in hours (default: 24)
MAX_MEMORIES_BEFORE_OPTIMIZE: Threshold for auto-optimization (default: 10000)
SIMILARITY_THRESHOLD: Default similarity threshold (default: 0.7)
MAX_RESULTS_PER_QUERY: Maximum results per query (default: 10)
BACKUP_RETENTION_DAYS: Number of days to keep backups (default: 7)
LOG_LEVEL: Logging level (default: INFO)
# Hardware-specific environment variables
PYTORCH_ENABLE_MPS_FALLBACK: Enable MPS fallback for Apple Silicon (default: 1)
MCP_MEMORY_USE_ONNX: Use ONNX Runtime for CPU-only deployments (default: 0)
MCP_MEMORY_USE_DIRECTML: Use DirectML for Windows acceleration (default: 0)
MCP_MEMORY_MODEL_NAME: Override the default embedding model
MCP_MEMORY_BATCH_SIZE: Override the default batch size
Platform | Architecture | Accelerator | Status |
---|---|---|---|
macOS | Apple Silicon (M1/M2/M3) | MPS | ✅ Fully supported |
macOS | Apple Silicon under Rosetta 2 | CPU | ✅ Supported with fallbacks |
macOS | Intel | CPU | ✅ Fully supported |
Windows | x86_64 | CUDA | ✅ Fully supported |
Windows | x86_64 | DirectML | ✅ Supported |
Windows | x86_64 | CPU | ✅ Supported with fallbacks |
Linux | x86_64 | CUDA | ✅ Fully supported |
Linux | x86_64 | ROCm | ✅ Supported |
Linux | x86_64 | CPU | ✅ Supported with fallbacks |
Linux | ARM64 | CPU | ✅ Supported with fallbacks |
python scripts/install_windows.py
python install.py --force-compatible-deps
python scripts/fix_sitecustomize.py
python scripts/verify_environment_enhanced.py
MCP_MEMORY_BATCH_SIZE=4
and try a smaller modelPYTORCH_ENABLE_MPS_FALLBACK=1
python scripts/test_installation.py
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "memory" '{"command":"uv","args":["--directory","your_mcp_memory_service_directory","run","memory"],"env":{"MCP_MEMORY_CHROMA_PATH":"your_chroma_db_path","MCP_MEMORY_BACKUPS_PATH":"your_backups_path"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"memory": {
"command": "uv",
"args": [
"--directory",
"your_mcp_memory_service_directory",
"run",
"memory"
],
"env": {
"MCP_MEMORY_CHROMA_PATH": "your_chroma_db_path",
"MCP_MEMORY_BACKUPS_PATH": "your_backups_path"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"memory": {
"command": "uv",
"args": [
"--directory",
"your_mcp_memory_service_directory",
"run",
"memory"
],
"env": {
"MCP_MEMORY_CHROMA_PATH": "your_chroma_db_path",
"MCP_MEMORY_BACKUPS_PATH": "your_backups_path"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect