mem0-mcp-server

odin2-hash/mem0-mcp-server

3.2

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.

Tools
6
Resources
0
Prompts
0

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 processing
  • searchMemories - Semantic search across user memories
  • getRelatedMemories - Graph-based retrieval of connected memories
  • getMemoryGraph - Visualize memory relationships
  • saveConversation - Store conversation contexts
  • getConversationHistory - 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)

  1. Docker Environment Setup - Multi-service configuration
  2. Multi-Database Memory Core - Neo4j, PostgreSQL, Redis integration
  3. MCP Memory Tools - Complete tool implementation
  4. GitHub OAuth Adaptation - Docker-compatible authentication
  5. Testing Infrastructure - Docker-specific test suite
  6. 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

  1. Docker Environment & TypeScript - Configuration validation
  2. Memory System Integration - Multi-database operations
  3. Multi-User Isolation - Security and performance testing
  4. 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

  1. Configure firewall rules for port 3000
  2. Set up automated backups for Docker volumes
  3. Configure monitoring and log aggregation
  4. 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.