mem0-mcp-server

by olk

Not rated
GitHub

About

mem0-mcp-server — exposes Mem0 persistent semantic memory as an MCP HTTP server; supports add/search/read/update/delete operations and semantic search for agent memory.

Details

Author
olk
Categories
AI, Knowledge Base, Other

Setup

Install mem0-mcp-server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/olk/mem0-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

MCP server exposing Mem0 v2 API for AI agents to store, retrieve, and search long-term memories using semantic search through the standardized MCP protocol.

Mem0-MCP Server is a self-hosted MCP (Model Context Protocol) server that bridges AI agents with persistent memory storage. It enables intelligent context retention across conversations and sessions using Mem0's AsyncMemory API.

- MCP Protocol Integration - Exposes Mem0 functionality via MCP tools
- Semantic Memory Search - Similarity-based memory retrieval with vector search
- Multi-Tenant Isolation - User/Agent/Session scoped memory isolation
- Flexible Transport - stdio for local agents, SSE for remote connections
- Configuration Management - Pydantic-based validation with environment variable support

# Clone and install git clone https://github.com/your-org/mem0-mcp-server.git cd mem0-mcp-server uv sync # Set environment variables export OPENAI_API_KEY="your-api-key"

Create~/.config/mem0-mcp-server/settings.json:

{ "vector_store": { "provider": "redis", "config": { "redis_url": "redis://localhost:6379" } }, "llm": { "provider": "openai", "config": { "model": "gpt-4o" } }, "embedder": { "provider": "openai", "config": { "model": "text-embedding-3-small" } } }
# SSE Transport (remote connections) uv run python -m mcp_server.main # stdio Transport (local AI agents) export MCP_TRANSPORT=stdio uv run python -m mcp_server.main
"mcp": { "mem0": { "type": "remote", "enabled": true, "url": "http://localhost:8050/sse" } }
# Add memory result = await client.call_tool("add_memory", { "messages": [{"role": "user", "content": "I prefer dark mode"}], "user_id": "alice" }) # Search memories result = await client.call_tool("search_memories", { "query": "theme preferences", "filters": {"user_id": "alice"}, "limit": 5 })
AI Agent → FastMCP Server → MemoryManager → Mem0 AsyncMemory → Redis │ │ ├── SafeLogger (stdout/stderr) │ ├── Transport (stdio/SSE) │ └── Config (Pydantic validation) │

- COMP-1: ConfigLoader - Configuration loading and validation
- COMP-2: FastMCP Server - MCP protocol server
- COMP-3: MemoryManager - Memory operations with multi-tenant isolation
- COMP-4: MCP Tools - Tool definitions
- COMP-5: SafeLogger - Output stream separation

Configuration values are resolved in order:
- Tool parameters (direct)
- Environment variables (with MCP_ prefix)
- Config file values
- Hardcoded defaults

# Using docker-compose docker-compose up -d # Using Makefile make docker-up # Start services with docker compose make docker-down # Stop services make docker-logs # Show logs

SeeDeployment → Dockerfor detailed configuration.

# Using Helm chart helm install mem0-mcp ./charts/mem0-mcp-server

Run multiple commands:make install && make lint && make typecheck && make test

SeeMakefilefor all available commands including Docker management (docker-up,docker-down,docker-logs, etc.).

mem0-mcp/ ├── src/mcp_server/ │ ├── __init__.py # FastMCP singleton │ ├── lifespan.py # Resource lifecycle │ ├── transport.py # Transport selection │ ├── memory/ │ │ ├── manager.py # MemoryManager │ │ └── lifespan.py # AsyncMemory lifecycle │ ├── config/ │ │ ├── settings.py # Pydantic models │ │ └── loader.py # Config file loading │ ├── tools/ │ │ ├── add_memory.py │ │ ├── search_memories.py │ │ └── ... │ └── utils/ │ └── safe_logger.py # Output separation ├── doc/ │ ├── api/ # API reference │ ├── patterns/ # Pattern guides │ ├── examples/ # Usage examples │ └── architecture/ # Architecture docs ├── tests/ ├── Makefile ├── Dockerfile └── docker-compose.yml

Self-hosted MCP server giving AI agents persistent memory — Markdown source of truth, hybrid BM25+embedding search, typed graph relations.

Long-term memory system for AI agents with semantic search, context management, and multi-format storage.

A self-hosted, secure, feature-rich memory system for AI agents and assistants. Provides intelligent fact extraction and deduplication, with an artifact store for detailed content.

Persistent memory for AI agents with Ebbinghaus forgetting curve decay, hybrid BM25 + vector + knowledge graph retrieval, temporal reasoning, and a local dashboard. 89.4% Recall@5 on LongMemEval.

Persistent cognitive memory for Claude Code. Cloud-based semantic search, Ai-powered extraction, project scoping, and compaction recovery.

Persistent memory layer for AI agents with semantic search, consolidation, and cross-session intelligence via MCP.

Local-first agent memory: a plain-Markdown Obsidian vault is the source of truth, with a rebuildable DuckDB index for hybrid BM25 + vector + graph recall.

Local Work Model for AI agents that learns from real outcomes.

Adaptive MCP memory system for AI applications. Learns which retrieval strategies work for your data, scores results using cognitive science models, builds a knowledge graph automatically, and validates every parameter change against real query history before adopting it. Patent pending.

Auditable, self-improving knowledge & memory for AI agents over MCP — citation-enforced answers and a replayable why-trace, self-hosted on Postgres.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.