Back to Mem0

Mem0 MCP

docs/platform/mem0-mcp.mdx

2.0.15.2 KB
Original Source
<Info> **Prerequisites** - Mem0 Platform account (<a href="https://app.mem0.ai?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Sign up here</a>) - API key (<a href="https://app.mem0.ai/settings/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Get one from dashboard</a>) - Node.js 14+ (for npx) - An MCP-compatible client (Claude, Claude Code, Cursor, Windsurf, VS Code, OpenCode) </Info>

What is Mem0 MCP?

Mem0 MCP Server exposes Mem0's memory capabilities as MCP tools, letting AI agents decide when to save, search, or update information. The cloud-hosted MCP server requires no local installation — just connect and start using memory.

Quick Setup

Add Mem0 MCP to your preferred clients with a single command:

bash
npx mcp-add \
  --name mem0-mcp \
  --type http \
  --url "https://mcp.mem0.ai/mcp" \
  --clients "claude,claude code,cursor,windsurf,vscode,opencode"

This automatically configures Mem0 MCP for all supported clients at once.

Available Tools

The MCP server exposes these memory tools to your AI client:

ToolDescription
add_memorySave text or conversation history for a user/agent
search_memoriesSemantic search across existing memories with filters
get_memoriesList memories with structured filters and pagination
get_memoryRetrieve one memory by its memory_id
update_memoryOverwrite a memory's text after confirming the ID
delete_memoryDelete a single memory by memory_id
delete_all_memoriesBulk delete all memories in scope
delete_entitiesDelete a user/agent/app/run entity and its memories
list_entitiesEnumerate users/agents/apps/runs stored in Mem0

Client-Specific Setup

You can also configure individual clients:

<AccordionGroup> <Accordion title="Claude Desktop"> ```bash npx mcp-add \ --name mem0-mcp \ --type http \ --url "https://mcp.mem0.ai/mcp" \ --clients "claude" ```
Or manually add to your Claude Desktop configuration (`claude_desktop_config.json`):
```json
{
  "mcpServers": {
    "mem0-mcp": {
      "type": "http",
      "url": "https://mcp.mem0.ai/mcp"
    }
  }
}
```
</Accordion> <Accordion title="Claude Code"> ```bash npx mcp-add \ --name mem0-mcp \ --type http \ --url "https://mcp.mem0.ai/mcp" \ --clients "claude code" ``` </Accordion> <Accordion title="Cursor"> ```bash npx mcp-add \ --name mem0-mcp \ --type http \ --url "https://mcp.mem0.ai/mcp" \ --clients "cursor" ```
Or go to Cursor → Settings → MCP and add:
```json
{
  "mcpServers": {
    "mem0-mcp": {
      "type": "http",
      "url": "https://mcp.mem0.ai/mcp"
    }
  }
}
```
</Accordion> <Accordion title="Windsurf"> ```bash npx mcp-add \ --name mem0-mcp \ --type http \ --url "https://mcp.mem0.ai/mcp" \ --clients "windsurf" ``` </Accordion> <Accordion title="VS Code"> ```bash npx mcp-add \ --name mem0-mcp \ --type http \ --url "https://mcp.mem0.ai/mcp" \ --clients "vscode" ``` </Accordion> <Accordion title="OpenCode"> ```bash npx mcp-add \ --name mem0-mcp \ --type http \ --url "https://mcp.mem0.ai/mcp" \ --clients "opencode" ``` </Accordion> </AccordionGroup>

Verify Your Setup

Once configured, your AI client can:

  • Automatically save information with add_memory
  • Search memories with search_memories
  • Update memories with update_memory
  • Delete memories with delete_memory

Sample Interactions:

User: Remember that I love tiramisu
Agent: Got it! I've saved that you love tiramisu.

User: What do you know about my food preferences?
Agent: Based on your memories, you love tiramisu.

User: Update my project: the mobile app is now 80% complete
Agent: Updated your project status successfully.
<Info icon="check"> If you get "Connection failed", ensure you have a valid API key from <a href="https://app.mem0.ai/settings/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Mem0 Dashboard</a>. </Info>

Quick Recovery

  • "Connection refused" → Check your internet connection and ensure the MCP client is correctly configured
  • "Invalid API key" → Get a new key from <a href="https://app.mem0.ai/settings/api-keys?utm_source=oss&utm_medium=platform-mem0-mcp" rel="nofollow">Mem0 Dashboard</a>
  • "npx command not found" → Install Node.js from nodejs.org

Next Steps

<CardGroup cols={2}> <Card title="MCP Integration Feature" description="Learn about MCP configuration options and advanced patterns" icon="plug" href="/platform/features/mcp-integration" /> <Card title="Gemini 3 with Mem0 MCP" description="See how to integrate Gemini 3 with Mem0 MCP server" icon="book-open" href="/cookbooks/frameworks/gemini-3-with-mem0-mcp" /> </CardGroup>

Additional Resources