Skip to main content
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:
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.
If neither is set up, the server replies 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:
Or manually add to your Claude Desktop configuration (claude_desktop_config.json):
Direct MCP (fastest, MCP only). Codex reads MCP servers from ~/.codex/config.toml as TOML (not JSON). Add:
Export 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.
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 mem0ai/mem0. The repo ships a marketplace manifest at .agents/plugins/marketplace.json, so you can register it with one CLI call:
Then run 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).
Or go to Cursor → Settings → MCP and add:

Check that it worked

Restart your client, then ask it to store something and read it back in a later message:
The second answer only works if the memory was really stored, so this is a genuine round-trip test rather than the model repeating itself. Two things to look for while you do it:
  • 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.
To confirm from outside the client, open the Mem0 dashboard: anything the agent saved appears there.

Troubleshooting


Next steps