← Back to Mem0 MCP Self-hosted
Install Mem0 MCP Self-hosted
Pick your client, copy the command, done.
1
Add it to Claude Code
claude mcp add -e "MEM0_USER_ID=${MEM0_USER_ID}" mem0-mcp-selfhosted -- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhostedRequired:
MEM0_USER_ID+ 2 optionalEnvironment Variables
Set these before running Mem0 MCP Self-hosted.
VariableDescriptionRequired
MEM0_USER_IDUnique identifier for the userYesMEM0_PROVIDERLLM provider for memory processing (e.g., ollama)NoMEM0_LLM_MODELModel to use for memory processingNoAvailable Tools (3)
Once configured, Mem0 MCP Self-hosted gives your AI agent access to:
search_memoriesSearch for relevant context in memory.queryadd_memoryAdd new information to persistent memory.dataupdate_memoryUpdate existing memory entries.memory_iddataTry It Out
After setup, try these prompts with your AI agent:
→Search my memories for TypeScript preferences.
→Remember that I prefer Hatch for Python packaging.
→Show me all entities in my knowledge graph.
→What do I usually do when I encounter a 404 error in this project?
Prerequisites & system requirements
- An MCP-compatible client (Claude Code, Cursor, Windsurf, Claude Desktop, or Codex)
- Python 3.8+ with pip installed
MEM0_USER_ID— Unique identifier for the user
Keep this setup from going cold
Save the docs, env vars, and workflow around Mem0 MCP Self-hosted in Conare so Claude Code, Codex, and Cursor remember it next time.