odin2-hash/mem0-mcp-server
If you are the rightful owner of mem0-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Mem0 MCP Server is a production-ready Model Context Protocol server designed for comprehensive agent memory management, featuring Docker deployment, multi-database architecture, and GitHub OAuth authentication.
Mem0 MCP Server
Production-ready Model Context Protocol (MCP) server for comprehensive agent memory management with Docker deployment, multi-database architecture, and GitHub OAuth authentication.
๐ Features
- Advanced Agent Memory: Long-term and short-term memory with semantic search, graph relationships, and structured data storage
- Multi-User Architecture: Secure user isolation with GitHub OAuth authentication and role-based access control
- Multi-Database Integration: Neo4j for knowledge graphs, PostgreSQL with pgvector for embeddings, and Redis for session management
- Docker Deployment: Complete containerized deployment on GCP VM with proper networking and persistence
- Platform Integration: Compatible with OpenWebUI, n8n, Flowise, and other AI platforms
- LLM-Powered Processing: Anthropic Claude integration for entity extraction, relationship discovery, and semantic chunking
๐๏ธ Architecture
Multi-Database Stack
- PostgreSQL + pgvector: Vector embeddings and semantic search
- Neo4j: Knowledge graph and relationship mapping
- Redis: Session management and caching
Memory Types
- Episodic Memory: Specific events and conversations with timestamps
- Semantic Memory: Facts, concepts, and knowledge extracted from interactions
- Procedural Memory: User preferences, workflows, and behavioral patterns
- Contextual Memory: Conversation threads and multi-turn dialogue context
MCP Tools Available
saveMemory
- Store memories with automatic processingsearchMemories
- Semantic search across user memoriesgetRelatedMemories
- Graph-based retrieval of connected memoriesgetMemoryGraph
- Visualize memory relationshipssaveConversation
- Store conversation contextsgetConversationHistory
- Retrieve dialog history- Administrative tools for memory management
๐ณ Docker Deployment
Prerequisites
- Docker and Docker Compose
- GCP VM or similar Linux environment
- GitHub OAuth App configured
Quick Start
# Clone the repository
git clone https://github.com/odin2-hash/mem0-mcp-server.git
cd mem0-mcp-server
# Copy environment configuration
cp .env.example .env
# Edit .env with your configuration
# Start all services
docker-compose up -d
# Check service health
docker-compose ps
Environment Variables
# GitHub OAuth
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret
# Database Configuration
DATABASE_URL=postgresql://mem0:password@mem0-postgres:5432/mem0
NEO4J_URI=neo4j://mem0-neo4j:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=password
REDIS_URL=redis://mem0-redis:6379
# AI Integration
ANTHROPIC_API_KEY=sk-ant-...
ANTHROPIC_MODEL=claude-3-sonnet-20240229
# Security
COOKIE_ENCRYPTION_KEY=your_32_byte_key
๐ Implementation Status
Based on the comprehensive PRP (Product Requirement Prompt) in PRPs/MEM0_MCP_PRP.md
:
โ Planning Complete
- Comprehensive PRP document created
- Architecture designed
- Task breakdown completed
- Docker deployment strategy defined
๐ง Implementation Tasks (Priority Order)
- Docker Environment Setup - Multi-service configuration
- Multi-Database Memory Core - Neo4j, PostgreSQL, Redis integration
- MCP Memory Tools - Complete tool implementation
- GitHub OAuth Adaptation - Docker-compatible authentication
- Testing Infrastructure - Docker-specific test suite
- Production Deployment - GCP VM deployment and validation
๐ง Development
Local Development
# Install dependencies
npm install
# Type check
npm run type-check
# Run tests
npm run test
Docker Development
# Build and start services
docker-compose up -d --build
# View logs
docker-compose logs -f mem0-mcp-server
# Execute commands in container
docker-compose exec mem0-mcp-server npm run health-check
๐งช Testing
Validation Levels
- Docker Environment & TypeScript - Configuration validation
- Memory System Integration - Multi-database operations
- Multi-User Isolation - Security and performance testing
- Platform Integration - External service compatibility
MCP Client Testing
# Test with MCP Inspector
npx @modelcontextprotocol/inspector@latest http://YOUR_GCP_VM_IP:3000/mcp
# Claude Desktop Integration
# Add to Claude Desktop config:
{
"mcpServers": {
"mem0-memory": {
"command": "npx",
"args": ["mcp-remote", "http://YOUR_GCP_VM_IP:3000/mcp"],
"env": {}
}
}
}
๐ค Platform Integration
OpenWebUI
Configure OpenWebUI to connect to the MCP server for memory operations.
n8n
Use webhook nodes to integrate workflow automation with memory context.
Flowise
Direct MCP client connection for conversational AI memory persistence.
๐ Documentation
- - Complete implementation guide
- - Development patterns and best practices
- - Anthropic Claude API integration
๐ Security
- GitHub OAuth 2.0 authentication
- User memory isolation
- SQL injection protection
- Role-based access control
- Docker security best practices
๐ Deployment
GCP VM Deployment
- Configure firewall rules for port 3000
- Set up automated backups for Docker volumes
- Configure monitoring and log aggregation
- Implement health check alerts
Monitoring
- Docker container health checks
- Database connection monitoring
- Memory operation performance tracking
- User activity logging
๐ License
MIT License - see file for details.
๐ค AI-Powered Development
This project leverages advanced AI development patterns:
- Comprehensive PRP-driven development
- Multi-database memory architectures
- LLM-powered content processing
- Containerized microservices deployment
Built with โค๏ธ for the AI agent community.