chore: merge origin/main into mintlify/af82bda4 and resolve conflicts

This commit is contained in:
mintlify[bot]
2026-09-16 11:46:52 +00:00
committed by GitHub
parent b5ae772eae
commit 08d9636491
693 changed files with 55668 additions and 22676 deletions
+64 -12
View File
@@ -1,21 +1,27 @@
---
title: Cursor
description: "Add persistent memory to Cursor with the Mem0 MCP server so your AI coding assistant remembers project context, decisions, and preferences across sessions."
description: "Add persistent memory to Cursor with automatic capture, explicit recall, a search tool, and six memory skills."
---
Add persistent memory to [**Cursor**](https://cursor.com) with the Mem0 MCP server. Your AI assistant forgets everything between sessions. Mem0 fixes that by connecting Cursor to Mem0's cloud memory layer via MCP so you can save and retrieve relevant context during coding sessions.
Add persistent memory to [**Cursor**](https://cursor.com) with the Mem0 plugin. Cursor captures completed work in the background, and its agent can search relevant project context in later sessions. You can also connect only the hosted MCP server when you do not need lifecycle capture.
<Info>Current plugin version: `0.3.1`.</Info>
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent).
## Prerequisites
Before setting up Mem0 with Cursor, ensure you have:
1. A Mem0 Platform account and API key:
- <a href="https://app.mem0.ai?utm_source=oss&utm_medium=integration-cursor" rel="nofollow">Sign up at app.mem0.ai</a>
- <a href="https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=integration-cursor" rel="nofollow">Get your API key</a> (starts with `m0-`)
- <a href="https://app.mem0.ai?utm_source=oss&utm_medium=integration-cursor">Sign up at app.mem0.ai</a>
- <a href="https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=integration-cursor">Get your API key</a> (starts with `m0-`)
2. Cursor installed ([cursor.com](https://cursor.com))
3. Your API key added to your shell profile (persists across sessions):
3. Python 3.10 or newer available as `python3`
4. Your API key added to your shell profile (persists across sessions):
<CodeGroup>
```bash zsh
@@ -35,13 +41,25 @@ source ~/.bashrc
## Installation
### Option A: One-Click Deeplink (MCP Only)
### Option A: Full Plugin (Recommended)
Add the Mem0 marketplace:
```bash
cursor-agent plugin marketplace add https://github.com/mem0ai/mem0
```
Open Cursor's **Customize** page or run `/plugins`, select the **Mem0 Plugins** marketplace, and install **Mem0** at user or project scope. Enter your Mem0 API key when Cursor asks for the plugin configuration, then restart Cursor.
The full plugin includes automatic capture, the `search_memories` recall tool, lifecycle hooks, and six memory skills.
### Option B: 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 Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=mem0&config=eyJtY3BTZXJ2ZXJzIjp7Im1lbTAiOnsidXJsIjoiaHR0cHM6Ly9tY3AubWVtMC5haS9tY3AvIiwiaGVhZGVycyI6eyJBdXRob3JpemF0aW9uIjoiVG9rZW4gJHtlbnY6TUVNMF9BUElfS0VZfSJ9fX19)
### Option B: npx (MCP Only)
### Option C: npx (MCP Only)
```bash
npx mcp-add \
@@ -51,7 +69,7 @@ npx mcp-add \
--clients "cursor"
```
### Option C: Manual Configuration (MCP Only)
### Option D: Manual Configuration (MCP Only)
Add the following to your `.cursor/mcp.json`:
@@ -73,9 +91,19 @@ Add the following to your `.cursor/mcp.json`:
</Info>
## Available MCP Tools
## What's included
Once installed, the following tools are available in every Cursor session:
| Component | Full plugin | MCP only |
| --- | :---: | :---: |
| Memory tools | `search_memories` | 9 CRUD tools |
| Automatic capture | Yes | No |
| Recall | `search_memories` | MCP search tools |
| Lifecycle hooks | Yes | No |
| Memory skills | 6 | No |
## MCP-only tools
Options B, C, and D expose the following hosted tools. The full plugin uses the focused `search_memories` tool and captures writes through lifecycle hooks.
| Tool | Description |
|------|-------------|
@@ -89,11 +117,29 @@ Once installed, the following tools are available in every Cursor session:
| `delete_entities` | Delete a user/agent/app/run entity and its memories |
| `list_entities` | List users/agents/apps/runs stored in Mem0 |
## Lifecycle hooks
The full plugin translates Cursor's native events into the shared Mem0 memory lifecycle:
| Cursor event | What Mem0 does |
| --- | --- |
| `sessionStart` | Initializes the project session and recovers pending capture |
| `beforeSubmitPrompt` | Observes the submitted prompt; recall stays tool-driven because this event cannot inject context |
| `postToolUse` / `postToolUseFailure` | Records useful tool results and failures |
| `afterAgentResponse` / `stop` | Captures the completed exchange |
| `preCompact` / `sessionEnd` | Flushes pending capture in the background |
<Note>
Cursor's `beforeSubmitPrompt` hook cannot add context to a prompt. Use `search_memories` to recall memories.
</Note>
The plugin does not register subagent start or stop hooks.
## Example Workflow
```text
# Session 1: Debugging a performance issue
You: The API endpoint /users is taking 3 seconds. Help me optimize it.
You: The API endpoint /users is taking 3 seconds. Help me optimize it. Prefer query-level fixes over caching.
# Cursor agent searches memories, proceeds with investigation.
# Mem0 stores what you said as yours:
@@ -109,10 +155,16 @@ You: The /orders endpoint is also slow, same pattern as before.
# Immediately checks for N+1 queries and missing indexes.
```
## Search and capture
The local `search_memories` tool accepts `query`, `top_k`, `category`, `scope` (`repo`, `dir`, or `mine`), and optional `run_id` with every scope. Use a known session ID to recall memories saved in that session; omit it to search across sessions. See [search scopes](/integrations/claude-code#search-scope) for the shared Python search contract, including legacy repository memory compatibility.
Captured prompts and responses retain their full redacted text without a per-message character cutoff. Large extraction inputs are split across requests without dropping message text; recall output and tool-result previews have separate limits.
## Troubleshooting
- **"Connection failed"**: Verify `MEM0_API_KEY` is set: `echo $MEM0_API_KEY`
- **Duplicate tools**: If you had a previous MCP config for `mem0`, remove it before installing the plugin
- **Duplicate tools**: Do not combine the full plugin with an MCP-only option. Remove the standalone `mem0` MCP entry before installing the plugin.
- **No tools appearing**: Go to Cursor Settings > MCP and verify the `mem0` server shows as connected
<CardGroup cols={2}>