Overview
- MCP Server — Connect to Mem0’s remote MCP server for memory tools (add, search, update, delete)
- Lifecycle Hooks — Automatic memory capture at session start, compaction, and user prompts (Marketplace install)
- SDK Skill — Teaches the agent how to integrate the Mem0 SDK into your applications
- Zero local dependencies — Cloud-hosted MCP server, no local setup required
Prerequisites
Before setting up Mem0 with Cursor, ensure you have:-
A Mem0 Platform account and API key:
- Sign up at app.mem0.ai
- Get your API key (starts with
m0-)
- Cursor installed (cursor.com)
- Your API key exported in your shell:
Installation
Option A — One-Click Deeplink (MCP Only)
The fastest way to get started. Click the link below to install the Mem0 MCP server directly in Cursor: Install Mem0 MCP in CursorOption B — npx (MCP Only)
Option C — Manual Configuration (MCP Only)
Add the following to your.cursor/mcp.json:
Option D — Cursor Marketplace (Full Plugin)
Install from the Cursor Marketplace for the complete experience including lifecycle hooks, the Mem0 SDK skill, and automatic memory capture.Start a new Cursor session and ask: “List my mem0 entities” or “Search my memories for hello”. If the
mem0 tools appear and respond, you’re all set.What’s Included
| Component | Marketplace Install | Deeplink / Manual / npx |
|---|---|---|
| MCP Server (9 memory tools) | Yes | Yes |
| Lifecycle Hooks | Yes | No |
| Mem0 SDK Skill | Yes | No |
Available MCP Tools
Once installed, the following tools are available in every Cursor session:| Tool | Description |
|---|---|
add_memory | Save text or conversation history for a user/agent |
search_memories | Semantic search across memories with filters |
get_memories | List memories with filters and pagination |
get_memory | Retrieve a specific memory by ID |
update_memory | Overwrite a memory’s text by ID |
delete_memory | Delete a single memory by ID |
delete_all_memories | Bulk delete all memories in scope |
delete_entities | Delete a user/agent/app/run entity and its memories |
list_entities | List users/agents/apps/runs stored in Mem0 |
Lifecycle Hooks (Marketplace Install)
When installed via the Cursor Marketplace, Mem0 hooks into Cursor’s lifecycle:Session Start
On every new session, the plugin prompts the agent to callsearch_memories to load relevant context from prior sessions.
User Prompt
Before processing each user message, the plugin searches Mem0 for relevant memories and injects them into context. Short prompts are skipped to minimize latency.Pre-Compaction
Before context compaction, the plugin captures a comprehensive session summary so nothing is lost when the context window resets.Example Workflow
Troubleshooting
- “Connection failed” — Verify
MEM0_API_KEYis set:echo $MEM0_API_KEY - Duplicate tools — If you had a previous MCP config for
mem0, remove it before installing the plugin - No tools appearing — Go to Cursor Settings > MCP and verify the
mem0server shows as connected - Hooks not running — Hooks require the Marketplace install (Option D). Deeplink/manual installs only provide MCP tools.
Mem0 MCP Setup
Detailed MCP configuration for all clients
Claude Code Integration
Add Mem0 memory to Claude Code workflows