Prerequisites
- Mem0 Platform account (Sign up here)
- API key (Get one from dashboard)
- Node.js 18+ (for npx)
- An MCP-compatible client (Claude, Claude Code, Codex, Cursor, Windsurf, VS Code, OpenCode)
What is Mem0 MCP?
MCP (Model Context Protocol) is a standard way for AI clients to call external tools. The Mem0 MCP server hands your agent a set of memory tools, so it can decide for itself when to save something, look something up, or update what it already knows. Nothing runs on your machine: the server is hosted by Mem0, and your client connects to it over HTTPS. Memories you store this way live in your Mem0 account, not on your computer.Quick setup
Point your clients at the hosted server with a single command:mcp-add is a helper that writes the Mem0 server into each client’s own MCP config file, so you do not have to edit them by hand. Name only the clients you actually use. If you would rather see the change yourself, every client’s manual config is under Client-specific setup.
Restart each client afterwards so it picks up the new server.
Signing in
The server is authenticated, so connecting is not enough on its own. There are two ways in:- Sign in through the client
- Use your API key
Most clients handle this for you. The first time your agent uses a Mem0 tool, the client opens a browser window asking you to authorize access to your Mem0 account. Approve it once and the client stores the token, refreshing it as needed.This is the easier path, and it is what happens by default if you followed the quick setup above.
401 Authentication required and your client reports the connection as failed.
Available tools
The MCP server exposes these memory tools to your AI client:Client-specific setup
You can also configure individual clients:Claude Desktop
Claude Desktop
claude_desktop_config.json):Claude Code
Claude Code
Codex
Codex
Direct MCP (fastest, MCP only). Codex reads MCP servers from Export Sideloaded plugin (full experience). If you want the memory protocol skill, Mem0 SDK skill, and opt-in lifecycle hooks alongside the MCP server, sideload the plugin from a clone of Then run
~/.codex/config.toml as TOML (not JSON). Add:MEM0_API_KEY in the shell you launch Codex from, then restart Codex. codex mcp add only supports stdio servers, so HTTP servers must be added via config.toml directly, or via the Plugins → Connect to a custom MCP → Streamable HTTP UI in the Codex app.Codex uses the server name
mem0 (not mem0-mcp like the other clients on this page) so it matches the name the bundled plugin registers if you ever sideload it later.mem0ai/mem0. The repo ships a marketplace manifest at .agents/plugins/marketplace.json, so you can register it with one CLI call:codex and /plugins, browse the Mem0 Plugins marketplace, and install Mem0. Don’t combine this with the Direct MCP setup above; the sideloaded plugin auto-registers mem0 via .codex-mcp.json, so a manual [mcp_servers.mem0] block would create a duplicate.See the Codex integration guide for full details, lifecycle-hook setup, and management commands (codex plugin marketplace upgrade / remove).Cursor
Cursor
Windsurf
Windsurf
VS Code
VS Code
OpenCode
OpenCode
Check that it worked
Restart your client, then ask it to store something and read it back in a later message:- Your client should show the Mem0 tools among its available tools. Most clients list them in a tools or MCP panel.
- The first tool call should trigger the browser sign-in described above, unless you configured an API key.
Troubleshooting
Next steps
- Platform quickstart: call Mem0 from your own code instead of through an agent
- Mem0 CLI: the same operations from your terminal
- MCP specification: the Model Context Protocol standard
- Gemini with Mem0 MCP: a worked example