TL;DR:
- MCP Memory Service: Universal AI memory service with semantic search for Claude Desktop, VS Code, and 13+ AI applications
- Python venv Installation: Isolated environment setup for clean, conflict-free installation
- Key Features: Semantic search, multi-client support, autonomous consolidation, SQLite-vec backend
- Prerequisites: Python 3.8+, git, uv package manager
Installing MCP Memory Service with Python venv: Complete Local Setup Guide
The MCP Memory Service is a powerful universal memory service that provides semantic search and persistent storage for AI assistants. It works seamlessly with Claude Desktop, VS Code, Cursor, and over 13 other AI applications, enabling them to maintain context across conversations and access previously stored knowledge.
This comprehensive guide will walk you through installing the MCP Memory Service using Python’s virtual environment (venv) on your local machine. This approach ensures a clean, isolated installation that won’t conflict with your system Python or other projects.
What is MCP Memory Service?
Before diving into the installation, let’s understand what makes this service valuable:
Core Features
- Semantic Memory Search: Uses vector embeddings for intelligent, natural language search
- Multi-Client Support: Works with Claude Desktop, Claude Code, VS Code, Cursor, and more
- Autonomous Consolidation: Automatically organizes and consolidates memories
- Flexible Storage: Supports SQLite-vec, ChromaDB, and Cloudflare backends
- Time-Based Queries: Search memories using natural language (“yesterday”, “last week”)
- Tag-Based Organization: Smart categorization and tagging system
Why Use Python venv?
- Isolation: Keeps dependencies separate from system Python
- Reproducibility: Ensures consistent environment across different machines
- Clean Uninstall: Easy to remove if needed
- Version Control: Prevents conflicts with other Python projects
Prerequisites
Before starting the installation, ensure you have the following:
System Requirements
- Python 3.8 or higher (Python 3.11+ recommended)
- Git for cloning the repository
- uv package manager (modern Python package manager)
- At least 2GB free disk space (for models and data)
- Supported OS: Linux, macOS, or Windows (WSL2)
Verify Prerequisites
# Check Python versionpython --version# Should show Python 3.8+ (preferably 3.11+)
# Check if git is installedgit --version
# Install uv if not presentcurl -LsSf https://astral.sh/uv/install.sh | sh# Or using pippip install uv
# Verify uv installationuv --versionStep-by-Step Installation Guide
Step 1: Clone the Repository
# Navigate to your preferred directorycd ~/projects # or any directory you prefer
# Clone the MCP Memory Service repositorygit clone https://github.com/doobidoo/mcp-memory-service.git
# Navigate into the project directorycd mcp-memory-serviceStep 2: Create Python Virtual Environment
# Create a virtual environment in the project directorypython -m venv venv
# Activate the virtual environment# On Linux/macOS:source venv/bin/activate
# On Windows:# venv\Scripts\activate
# Verify activation (you should see (venv) in your prompt)which python# Should point to: /path/to/mcp-memory-service/venv/bin/pythonStep 3: Install Dependencies with uv
# Install dependencies using uv (recommended)uv pip install -e .
# Alternative: Install with pip# pip install -e .Step 4: Initialize the Service
# Run the installation scriptpython install.py
# Or manually initializeuv run memory initStep 5: Configure Storage Backend
The service supports multiple storage backends. For local installation, SQLite-vec is recommended:
# Set environment variables for SQLite-vec backendexport MCP_MEMORY_STORAGE_BACKEND=sqlite_vec
# Optional: Enable HTTP API for web dashboardexport MCP_HTTP_ENABLED=trueexport MCP_HTTP_PORT=8000
# Optional: Set API key for securityexport MCP_API_KEY="your-secure-api-key-here"Step 6: Test the Installation
# Test basic functionalityuv run memory health
# Store a test memoryuv run memory store "Test memory: Installation completed successfully"
# Search for the memoryuv run memory recall "installation test"
# Check service statusuv run memory statusIntegration with AI Applications
Claude Desktop Integration
-
Locate Claude Desktop Configuration:
Terminal window # On macOS~/Library/Application Support/Claude/claude_desktop_config.json# On Windows%APPDATA%\Claude\claude_desktop_config.json# On Linux~/.config/Claude/claude_desktop_config.json -
Add MCP Configuration:
{"mcpServers": {"memory": {"command": "uv","args": ["--directory", "/path/to/mcp-memory-service", "run", "memory", "server"],"env": {"MCP_MEMORY_STORAGE_BACKEND": "sqlite_vec"}}}} -
Restart Claude Desktop to load the new configuration.
VS Code Integration
- Install the MCP extension for VS Code
- Configure the memory service in VS Code settings
- Restart VS Code to enable the integration
Cursor Integration
- Open Cursor settings
- Add MCP server configuration
- Point to your local MCP Memory Service
- Restart Cursor to activate
Advanced Configuration
Environment Variables
# Storage Configurationexport MCP_MEMORY_STORAGE_BACKEND=sqlite_vec # or chromadb, cloudflareexport MCP_MEMORY_DB_PATH=./data/memory.db
# HTTP API Configurationexport MCP_HTTP_ENABLED=trueexport MCP_HTTP_HOST=localhostexport MCP_HTTP_PORT=8000export MCP_API_KEY=your-secure-key
# Performance Tuningexport MCP_MEMORY_MAX_WORKERS=4export MCP_MEMORY_BATCH_SIZE=100
# Loggingexport MCP_LOG_LEVEL=INFOexport MCP_LOG_FILE=./logs/memory.logCustom Configuration File
Create a .env file in the project root:
# .env fileMCP_MEMORY_STORAGE_BACKEND=sqlite_vecMCP_HTTP_ENABLED=trueMCP_HTTP_PORT=8000MCP_API_KEY=your-secure-api-keyMCP_MEMORY_MAX_WORKERS=4Troubleshooting Common Issues
First-Time Setup Warnings
On first run, you might see warnings that are completely normal:
WARNING: Failed to load from cache: No snapshots directoryWARNING: Using TRANSFORMERS_CACHE is deprecatedThese warnings disappear after the first successful run. The service downloads a ~25MB embedding model on first use.
Python Version Issues
# If you have multiple Python versionspython3.11 -m venv venvsource venv/bin/activatepython --version # Should show 3.11.xPermission Issues
# On Linux/macOS, ensure proper permissionschmod +x venv/bin/pythonchmod +x venv/bin/uvPort Conflicts
# Check if port 8000 is availablelsof -i :8000
# Change port if neededexport MCP_HTTP_PORT=8001Memory Issues
# For systems with limited RAMexport MCP_MEMORY_MAX_WORKERS=2export MCP_MEMORY_BATCH_SIZE=50Usage Examples
Basic Memory Operations
# Store a memory with tagsuv run memory store "Fixed authentication bug by adding proper validation" --tags python,security,bugfix
# Search by natural languageuv run memory recall "authentication validation issues"
# Search by tagsuv run memory search --tags python security
# Search by timeuv run memory recall "yesterday afternoon"
# List all memoriesuv run memory list --limit 10Advanced Queries
# Complex search with multiple criteriauv run memory recall "database optimization" --tags performance --since "2024-01-01"
# Export memoriesuv run memory export --format json --output memories_backup.json
# Import memoriesuv run memory import --file memories_backup.jsonPerformance Optimization
For Local Development
# Use SQLite-vec for fastest local performanceexport MCP_MEMORY_STORAGE_BACKEND=sqlite_vec
# Optimize worker count for your CPUexport MCP_MEMORY_MAX_WORKERS=$(nproc)For Production Use
# Enable HTTP API for web dashboardexport MCP_HTTP_ENABLED=true
# Set up proper loggingexport MCP_LOG_LEVEL=WARNINGexport MCP_LOG_FILE=/var/log/mcp-memory.log
# Configure backupexport MCP_BACKUP_ENABLED=trueexport MCP_BACKUP_INTERVAL=3600 # 1 hourSecurity Considerations
API Key Protection
# Generate a secure API keyopenssl rand -hex 32
# Set the keyexport MCP_API_KEY="your-generated-secure-key"Network Security
# Bind to localhost onlyexport MCP_HTTP_HOST=127.0.0.1
# Use HTTPS in productionexport MCP_SSL_CERT=/path/to/cert.pemexport MCP_SSL_KEY=/path/to/key.pemData Encryption
# Enable database encryptionexport MCP_ENCRYPTION_ENABLED=trueexport MCP_ENCRYPTION_KEY="your-encryption-key"Maintenance and Updates
Regular Maintenance
# Check service healthuv run memory health
# Clean up old memories (optional)uv run memory cleanup --older-than 90days
# Optimize databaseuv run memory optimizeUpdating the Service
# Pull latest changesgit pull origin main
# Update dependenciesuv pip install -e . --upgrade
# Restart the service# If running as service, restart it# If running manually, stop and restartBackup and Restore
# Create backupuv run memory backup --output backup_$(date +%Y%m%d).tar.gz
# Restore from backupuv run memory restore --input backup_20240908.tar.gzIntegration Examples
With Claude Code
# Claude Code integrationexport MCP_CLAUDE_CODE_ENABLED=trueexport MCP_CLAUDE_CODE_HOOKS_DIR=./claude-hooksWith Development Workflows
# Git integrationuv run memory store "Merged feature branch with conflict resolution" --tags git,merge,conflict
# Code review notesuv run memory store "Code review: Add input validation to API endpoints" --tags review,api,securityMonitoring and Analytics
Service Metrics
# View service statisticsuv run memory stats
# Monitor memory usageuv run memory usage
# Check query performanceuv run memory performanceLogging Configuration
# Detailed loggingexport MCP_LOG_LEVEL=DEBUGexport MCP_LOG_FORMAT=json
# Log rotationexport MCP_LOG_MAX_SIZE=100MBexport MCP_LOG_BACKUP_COUNT=5Conclusion
Installing MCP Memory Service with Python venv provides a clean, isolated environment for running this powerful AI memory service locally. The virtual environment approach ensures that dependencies are managed separately from your system Python, preventing conflicts and making maintenance easier.
Key Benefits of This Installation Method
- Isolation: Dependencies don’t conflict with system Python
- Reproducibility: Same environment across different machines
- Easy Updates: Simple to upgrade or modify
- Clean Removal: Easy to uninstall if needed
- Development Friendly: Great for testing and development
Next Steps
- Explore the Web Dashboard: Access
http://localhost:8000for the web interface - Integrate with Your AI Tools: Connect Claude Desktop, VS Code, or other supported applications
- Customize Configuration: Adjust settings for your specific use case
- Set Up Backups: Configure regular backups for important memories
- Monitor Performance: Use the built-in monitoring tools to optimize usage
The MCP Memory Service transforms how AI assistants work by providing persistent, searchable memory across conversations and sessions. With semantic search capabilities and multi-client support, it significantly enhances productivity for developers, researchers, and anyone working with AI tools.
Further Reading
Official Documentation
- MCP Memory Service Wiki - Complete documentation and guides
- Installation Guide - Detailed installation instructions
- Configuration Guide - Advanced setup options
Related Resources
- Model Context Protocol - Learn about MCP protocol
- Claude Desktop - Official Claude Desktop application
- uv Package Manager - Modern Python package management
Community and Support
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Community discussions and help
- Troubleshooting Guide - Solutions for common issues
For the latest updates and community contributions, follow the MCP Memory Service repository and join the growing community of users leveraging AI memory capabilities.

