The support ticket that surfaced this found three overlapping issues: 1. docs/integrations/codex.mdx shipped a marketplace.json snippet with path "./plugins/mem0" — a directory that does not exist, with no clone prerequisite documented, and using a folder name that does not match the actual mem0-plugin/ directory. Users copy-pasted it verbatim and hit "plugin/read failed in TUI". 2. The "Manual MCP Configuration" option used a JSON mcpServers block. Codex reads MCP servers as TOML in ~/.codex/config.toml, not JSON. Same bug in docs/platform/mem0-mcp.mdx (no Codex accordion at all on main) and mem0-plugin/README.md Option C. 3. The page claimed "Codex uses a skill-based approach instead of lifecycle hooks" — stale; hooks are now available via opt-in installer (mem0-plugin/scripts/install_codex_hooks.py). Lead with the working TOML MCP config (zero dependencies, works today), demote the marketplace.json to a "Sideload (Advanced)" section with the required git clone step and the correct mem0-plugin path, and point sideloaders at the hooks installer + codex_hooks feature flag. Added troubleshooting entries for the TUI read error and hooks-not-firing.
Mem0 Plugin for Claude Code, Claude Cowork, Cursor & Codex
Add persistent memory to your AI workflows. Store, retrieve, and manage memories across sessions using the Mem0 Platform. Works with Claude Code (CLI), Claude Cowork (desktop app), Cursor, and Codex.
Step 1: Set your API key
You must complete this step before installing the plugin.
-
Sign up at app.mem0.ai if you haven't already
-
Click Create API Key and copy the key (starts with
m0-) -
Add it to your shell profile:
# For zsh (default on macOS) echo 'export MEM0_API_KEY="m0-your-api-key"' >> ~/.zshrc source ~/.zshrc # For bash echo 'export MEM0_API_KEY="m0-your-api-key"' >> ~/.bashrc source ~/.bashrc -
Confirm it's set:
echo $MEM0_API_KEY # Should print: m0-your-api-key
Step 2: Install the plugin
Choose one of the options below. All require MEM0_API_KEY to be set first (see above).
Claude Code (CLI) / Claude Cowork (Desktop)
Claude Code and Claude Cowork share the same plugin system.
CLI:
/plugin marketplace add mem0ai/mem0
/plugin install mem0@mem0-plugins
Cowork desktop app: Open the Cowork tab, click Customize in the sidebar, click Browse plugins, and install Mem0.
This installs the full plugin including the MCP server, lifecycle hooks (automatic memory capture), and the Mem0 SDK skill.
Codex
Option A — Repo marketplace (recommended for teams):
Add the plugin marketplace to your repo root (already included in this repository):
.agents/plugins/marketplace.json
Then in Codex, browse the repo's plugin directory and install Mem0.
Option B — Personal marketplace:
Add to ~/.agents/plugins/marketplace.json:
{
"name": "mem0-plugins",
"interface": {
"displayName": "Mem0 Plugins"
},
"plugins": [
{
"name": "mem0",
"source": {
"source": "local",
"path": "/path/to/mem0/mem0-plugin"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}
]
}
Option C — Direct MCP configuration (fastest, MCP-only):
Codex reads MCP servers from ~/.codex/config.toml as TOML. Add:
[mcp_servers.mem0]
url = "https://mcp.mem0.ai/mcp"
bearer_token_env_var = "MEM0_API_KEY"
Export MEM0_API_KEY in your shell and restart Codex. This gives you the MCP tools without the plugin skills or lifecycle hooks. codex mcp add only supports stdio servers, so HTTP servers like Mem0's must be added via config.toml directly (or via the Plugins → Connect to a custom MCP → Streamable HTTP UI in the Codex app).
Cursor
Already have
mem0configured as an MCP server? Remove the existing entry from your Cursor MCP settings before installing to avoid duplicate tools.
Option A — One-click deeplink (installs MCP server only):
Option B — Manual configuration (MCP server only):
Add the following to your .cursor/mcp.json:
{
"mcpServers": {
"mem0": {
"url": "https://mcp.mem0.ai/mcp/",
"headers": {
"Authorization": "Token ${env:MEM0_API_KEY}"
}
}
}
}
Option C — Cursor Marketplace (full plugin with hooks and skills):
Install from the Cursor Marketplace for the complete experience including lifecycle hooks and the Mem0 SDK skill.
Verify it works
After installing, confirm the MCP server is connected:
- Start a new session (or restart your current one)
- Ask: "List my mem0 entities" or "Search my memories for hello"
- If the
mem0tools appear and respond, you're all set
What's included
| Component | Claude Code / Cowork | Cursor (Marketplace) | Cursor (Deeplink/Manual) | Codex |
|---|---|---|---|---|
| MCP Server | Yes | Yes | Yes | Yes |
| Lifecycle Hooks | Yes | Yes | No | No |
| Mem0 SDK Skill | Yes | Yes | No | Yes |
| Memory Protocol Skill | No | No | No | Yes |
- MCP Server — Connects to the Mem0 remote MCP server (
mcp.mem0.ai), providing tools to add, search, update, and delete memories. No local dependencies required. - Lifecycle Hooks — Automatic memory capture at key points: session start, context compaction, task completion, and session end. (Claude Code/Cursor only)
- Mem0 SDK Skill — Guides the AI on how to integrate the Mem0 SDK (Python & TypeScript) into your applications.
- Memory Protocol Skill — Codex-specific skill that instructs the agent to retrieve relevant memories at task start, store learnings on completion, and capture session state before context loss. Replaces lifecycle hooks on platforms that don't support them.
MCP Tools
Once installed, the following tools are available:
| 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 |
License
Apache-2.0