mem0-mcp-selfhosted
by elvismdev·★ 84·Score 48
A self-hosted mem0 MCP server that integrates with Qdrant, Neo4j, and Ollama for persistent memory management with Claude Code.
Overview
This is a complete MCP server implementation for mem0, enabling persistent memory across Claude Code sessions. It provides 11 MCP tools for memory management and supports both cloud-based Anthropic (Claude) and fully local Ollama configurations. The server integrates multiple backend services including Qdrant for vector storage, Neo4j for knowledge graphs, and Ollama for embeddings and optionally LLM services. The implementation is production-ready with comprehensive documentation, multiple authentication methods, and session hooks for automatic memory injection and saving.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this when you need persistent, cross-session memory for Claude Code with full control over your data infrastructure.
When NOT to choose this
Avoid if you want a cloud-based solution without managing your own vector database and graph storage infrastructure.
Tools this server exposes
11 tools extracted from the READMEadd_memoryStore text or conversation history as memories
search_memoriesSemantic search for relevant memories with optional filters
get_memoriesList and filter memories by scope
get_memoryFetch a specific memory by its UUID
update_memoryUpdate the text of an existing memory
delete_memoryDelete a single memory by its UUID
delete_all_memoriesBulk delete all memories in a specified scope
list_entitiesList all users/agents with their memory counts
delete_entitiesDelete an entity and all its associated memories
search_graphSearch Neo4j entities by name and retrieve relationships
get_entityGet all relationships for a specific entity
Comparable tools
Installation
# Add globally with default Anthropic provider
claude mcp add --scope user --transport stdio mem0 \
--env MEM0_USER_ID=your-user-id \
-- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhosted
# Add with fully local Ollama configuration
claude mcp add --scope user --transport stdio mem0 \
--env MEM0_PROVIDER=ollama \
--env MEM0_LLM_MODEL=qwen3:14b \
--env MEM0_USER_ID=your-user-id \
-- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhosted
# For project-specific setup, create .mcp.json
{
"mcpServers": {
"mem0": {
"command": "uvx",
"args": ["--from", "git+https://github.com/elvismdev/mem0-mcp-selfhosted.git", "mem0-mcp-selfhosted"],
"env": {
"MEM0_PROVIDER": "ollama",
"MEM0_LLM_MODEL": "qwen3:14b",
"MEM0_USER_ID": "your-user-id"
}
}
}
}FAQ
- Can I use this MCP server with AI providers other than Anthropic and Ollama?
- Currently, the server supports Anthropic (Claude) and Ollama as LLM providers. The embedding generation uses Ollama with bge-m3 by default, but this could potentially be configured for other embedding models.
- What's the difference between hooks and CLAUDE.md rules for memory management?
- Hooks handle automatic memory at session boundaries - injecting memories on startup and saving summaries on exit. CLAUDE.md rules provide behavioral instructions that tell Claude to actively search and save memories during the session. Using both together provides the best experience.
On Hacker News
Recent discussion from the developer community.
- Story by elvismdev · 2026-02-17
- Story by elvismdev · 2026-02-19
Compare mem0-mcp-selfhosted with
Last updated · Auto-generated from public README + GitHub signals.