Skip to content

feat: add Mem0 plugin for Claude Code and Cursor#4518

Merged
deshraj merged 15 commits intomem0ai:mainfrom
gabrielstein-mem0:feat/claude-plugin
Mar 25, 2026
Merged

feat: add Mem0 plugin for Claude Code and Cursor#4518
deshraj merged 15 commits intomem0ai:mainfrom
gabrielstein-mem0:feat/claude-plugin

Conversation

@gabrielstein-mem0
Copy link
Copy Markdown
Contributor

@gabrielstein-mem0 gabrielstein-mem0 commented Mar 23, 2026

Summary

Adds an official Mem0 plugin for Claude Code and Cursor, giving both tools persistent memory via the Mem0 MCP server.

What's included

  • Plugin manifests.claude-plugin/plugin.json, .cursor-plugin/plugin.json, and MCP config (.mcp.json) connecting to the remote Mem0 MCP server at mcp.mem0.ai (no local dependencies)
  • Marketplace registry.claude-plugin/marketplace.json at the repo root for self-hosted plugin distribution (/plugin marketplace add mem0ai/mem0)
  • Lifecycle hooks — automatic memory capture on session start, task completion, stop, pre-compact, and per-user-prompt retrieval
  • Mem0 skillskills/mem0/ with SKILL.md, 7 reference docs (quickstart, SDK guide, API reference, architecture, features, integration patterns, use cases), a live doc search script, and Apache-2.0 LICENSE
  • Contact email standardization — updates docs/openapi.json and pyproject.toml to use support@mem0.ai

Plugin directory structure

mem0-plugin/
├── .claude-plugin/plugin.json
├── .cursor-plugin/plugin.json
├── .mcp.json
├── README.md
├── logo.svg
├── hooks/hooks.json
├── scripts/          # hook scripts (session start, stop, compact, etc.)
└── skills/mem0/      # skill definition + reference docs

Test plan

  • Installed via /plugin marketplace add mem0ai/mem0 and /plugin install mem0@mem0-plugins in Claude Code
  • Verified MCP tools (add_memory, search_memories, etc.) connect and respond
  • Confirmed lifecycle hooks fire on session start, task completion, and user prompts
  • Tested Cursor deeplink installation
  • No changes to core mem0ai package runtime code

Add plugin structure for the Claude Code marketplace with MCP server
configuration (mem0-mcp-server via uvx) and the mem0 integration skill.
- Add version, repository, and license to plugin.json
- Remove optional MEM0_DEFAULT_USER_ID from .mcp.json env
Users can now install the mem0 plugin directly from the repo:
  /plugin marketplace add mem0ai/mem0
  /plugin install mem0@mem0
Pre-stable release versioning for plugin, marketplace, and skill.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Switch from launching a local mem0-mcp-server process via uvx to
connecting directly to the hosted MCP at mcp.mem0.ai.
Add 5 lifecycle hooks that integrate with the Mem0 MCP server:
- SessionStart: bootstraps mem0 context on startup/resume/compact
- PreToolUse: blocks writes to MEMORY.md, redirects to mem0 MCP
- PreCompact: prompts session summary + direct API transcript capture
- Stop: prompts learnings persistence + background transcript capture
- TaskCompleted: prompts extraction of task learnings

Also fix .mcp.json to use standard mcpServers wrapper with type: http.
Search mem0 for relevant memories on every user message and inject
them as context before Claude processes the prompt. Skips short
prompts (< 20 chars) and uses a 3s timeout to minimize latency.
Remove stale uv/uvx prerequisite, fix MCP server description to
reflect remote HTTP setup, add step-by-step API key instructions
with verification, add post-install verification section, and
replace fictional skill install methods with plugin reference.
Restructure README into numbered steps so it's obvious that
MEM0_API_KEY setup is a prerequisite for both Claude Code and
Cursor plugin installation. Also add Cursor plugin files, logo,
and update marketplace source path.
@gabrielstein-mem0 gabrielstein-mem0 changed the title Feat/claude plugin feat: add Mem0 plugin for Claude Code and Cursor Mar 24, 2026
@whysosaket
Copy link
Copy Markdown
Member

Hi @gabrielstein-mem0, thank you so much for the PR. Wondering why do we need two separate skills. We already have skills in our main repo, can we not improve that and reuse it?

@whysosaket
Copy link
Copy Markdown
Member

Also, can you please sign the CLA @gabrielstein-mem0 ?

@gabrielstein-mem0
Copy link
Copy Markdown
Contributor Author

Hi @gabrielstein-mem0, thank you so much for the PR. Wondering why do we need two separate skills. We already have skills in our main repo, can we not improve that and reuse it?

These skills are specifically packaged within the plugin so that new users who don't have the skills already installed, get them immediately. This is especially useful when we are live in the official claude and cursor marketplace and will have more non-technical people installing the plugin via these tools.

Unfortunately we have no choice but to duplicate.

@whysosaket
Copy link
Copy Markdown
Member

Hi @gabrielstein-mem0, thank you so much for the PR. Wondering why do we need two separate skills. We already have skills in our main repo, can we not improve that and reuse it?

These skills are specifically packaged within the plugin so that new users who don't have the skills already installed, get them immediately. This is especially useful when we are live in the official claude and cursor marketplace and will have more non-technical people installing the plugin via these tools.

Unfortunately we have no choice but to duplicate.

Can we instead add a bash script or something that will download this from our repo? Since the repo is public?

@gabrielstein-mem0
Copy link
Copy Markdown
Contributor Author

I think for now we can merge it as it is.

The plugins have to ship with the skills bundled, for them to be indexed correctly.

I think we can look into adding another script into the build process where we copy the skills from root directory, but this shouldn't be a blocker for now.

(Pasting here from slack discussion)

@deshraj deshraj merged commit 3c2683c into mem0ai:main Mar 25, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants