docs/platform/features/mcp-integration.mdx
Model Context Protocol (MCP) provides a standardized way for AI agents to manage their own memory through Mem0, without manual API calls.
When building AI applications, memory management often requires manual integration. MCP eliminates this complexity by:
Add Mem0 MCP to all supported clients with a single command:
npx mcp-add \
--name mem0-mcp \
--type http \
--url "https://mcp.mem0.ai/mcp" \
--clients "claude,claude code,cursor,windsurf,vscode,opencode"
Or configure a specific client:
npx mcp-add \
--name mem0-mcp \
--type http \
--url "https://mcp.mem0.ai/mcp" \
--clients "cursor"
For manual configuration, add this to your MCP client config:
{
"mcpServers": {
"mem0-mcp": {
"type": "http",
"url": "https://mcp.mem0.ai/mcp"
}
}
}
For detailed per-client instructions, see the Mem0 MCP Quickstart.
The MCP server exposes 9 memory tools to your AI client:
| Tool | Purpose |
|---|---|
add_memory | Store conversations or facts |
search_memories | Find relevant memories with filters |
get_memories | List memories with pagination |
update_memory | Modify existing memory content |
delete_memory | Remove specific memories |
delete_all_memories | Bulk delete memories |
delete_entities | Remove user/agent/app entities |
get_memory | Retrieve single memory by ID |
list_entities | View stored entities |
Once connected, your AI agent can:
User: Remember that I'm allergic to peanuts
Agent: [calls add_memory] Got it! I've saved your peanut allergy.
User: What dietary restrictions do I know about?
Agent: [calls search_memories] You have a peanut allergy.
The agent automatically decides when to use memory tools based on context.
# Multi-task operations
"Generate 5 user personas for our e-commerce app with different demographics, store them all, then search for existing personas"
# Natural context retrieval
"Anything about my work preferences I should remember?"
# Complex information updates
"Update my current project: the mobile app is now 80% complete, we've fixed the login issues, and the launch date is March 15"
# Time-based queries
"What meetings did I have last week about Project Phoenix?"
# Memory cleanup
"Delete all test data and temporary memories from our development phase"
# Personal preferences
"I drink oat milk cappuccino with one sugar every morning, and I prefer standing desks"
# Health and wellness tracking
"I'm allergic to peanuts and shellfish, and I go for 5km runs on weekday mornings"
These examples demonstrate how MCP enables natural language memory operations - the AI agent automatically determines when to add, search, update, or delete memories based on context.
The Mem0 MCP server enables powerful memory capabilities for your AI applications:
https://mcp.mem0.ai/mcp handles infrastructure for youuser_id: "*" to search across all users