Blog
Share memory between Claude and Cursor
Point Claude Code and Cursor at the same AgentVault MCP endpoint so facts saved in one tool can be recalled in the other.
If you use Claude Code in the terminal and Cursor in the editor on the same repository, each tool starts from what it can see in the files and in the current session. CLAUDE.md, AGENTS.md and .cursorrules help, but they are documents, not a shared store. They do not search well, they do not keep a history of who changed a fact, and they do not update in the other app the moment an agent writes something down.
AgentVault is one memory both clients can read and write over MCP. A deploy rule you save in Claude Code can be recalled in Cursor, and the other way around. The endpoint is the same in both places: https://api.useagentvault.com/mcp, authenticated with Authorization: Bearer $AGENTVAULT_API_KEY.
This guide uses AgentVault’s published CLI and MCP snippets, Cursor’s MCP docs at cursor.com/docs/mcp, and Claude Code’s MCP docs at code.claude.com/docs/en/mcp. It does not invent a marketplace listing or a one-click Cursor install that AgentVault has not documented.
How the sharing actually works
Both apps are MCP clients. They do not sync files with each other. They send remember, recall and search calls to the same AgentVault space. Every memory can record the agent, model, provider and app that wrote it, so you can see whether a fact came from claude-code or from Cursor. If two writes use the same key, the new value supersedes the old one and history is kept.
On Team plans, a team space can be shared with owner, editor and viewer roles. Each person uses their own API key. A key can be scoped to specific spaces as read or read-write, and it can never do more than the person who created it.
1. One command if both tools are on the machine
Create a key at the API keys console. Then:
export AGENTVAULT_API_KEY=your-key npx @useagentvault/cli connect npx @useagentvault/cli status
AgentVault’s quickstart says this command signs you in and wires up every client it finds. For Claude Code it adds the MCP server and recall hooks. For Cursor it writes the agentvault server to ~/.cursor/mcp.json.
Restart Cursor after the file changes. In Claude Code, check /mcp. The Free plan (10,000 memories) is enough to run the test at the end of this page.
2. Manual Cursor config
Cursor reads MCP servers from ~/.cursor/mcp.json (global, all projects) and from .cursor/mcp.json in the project root (project-specific, can be committed). Project entries override same-named global ones.
For a remote server, Cursor’s docs use a url and optional headers. That matches what AgentVault publishes:
{
"mcpServers": {
"agentvault": {
"url": "https://api.useagentvault.com/mcp",
"headers": {
"Authorization": "Bearer $AGENTVAULT_API_KEY"
}
}
}
}Save the file and restart Cursor. Open the MCP or tools panel and confirm agentvault is connected. If Cursor does not expand $AGENTVAULT_API_KEY from your shell, use the environment-variable syntax Cursor documents, or a secret Cursor already has access to. Do not commit a live key. Official references: cursor.com/docs/mcp and cursor.com/help/customization/mcp.
Windsurf uses the same JSON shape in ~/.codeium/windsurf/mcp_config.json, per AgentVault’s MCP page. VS Code / GitHub Copilot uses .vscode/mcp.json with type: http and a servers map — also documented there if you want a third client on the same memory.
3. Manual Claude Code config
Do not paste the Cursor snippet unchanged
type field on HTTP servers. Cursor’s documented remote shape does not use that field.Official command:
claude mcp add --transport http agentvault https://api.useagentvault.com/mcp --header "Authorization: Bearer $AGENTVAULT_API_KEY"
Or in .mcp.json (project scope, shareable):
{
"mcpServers": {
"agentvault": {
"type": "http",
"url": "https://api.useagentvault.com/mcp",
"headers": {
"Authorization": "Bearer $AGENTVAULT_API_KEY"
}
}
}
}Details, including local, project and user scopes, are in Give Claude Code long-term memory.
4. A worked round-trip
Use one AgentVault account and, for a first test, your personal space.
In Claude Code, ask: Save this durable fact with key deploy.window: Production deploys go out on Tuesdays and Thursdays after 14:00 GST.
Confirm from the terminal:
npx @useagentvault/cli recall "when do we deploy"
In Cursor, in the same project, start a new agent chat and ask: When do we deploy to production? The answer should come from memory, not from a guess, and it should be possible to see that the fact was written from Claude Code (provenance) if the client surfaces it.
Then reverse it: in Cursor, update the fact (same key) with a new window, and recall it from a fresh Claude Code session. The new value should supersede the old one; history remains in AgentVault if you look up the memory by id.
If Cursor cannot see the fact:
- Confirm both clients use the same account and the same space.
- Confirm both actually connected (MCP panel or /mcp), not just that a JSON file exists.
- Confirm the API key has write access in one client and at least read access in the other.
- Restart the app after editing mcp.json. Cursor’s docs say to restart.
5. Bring a team in
For a shared project memory:
- Create a team space in AgentVault and invite teammates by email.
- Each person creates their own API key and runs
npx @useagentvault/cli connect, or the manual configs above. - Point everyone at the team space, not only a personal space. Personal preferences can stay in each person’s personal space.
- Prefer a project-level Cursor
.cursor/mcp.jsonand a Claude Code.mcp.jsonthat reference an environment variable, so the repo carries the server name and URL without carrying secrets.
Team spaces, roles and private memories inside shared spaces are documented in concepts and on pricing (Team adds shared spaces and unlimited memories).
You can also paste the team setup prompt from the AgentVault homepage into Claude Code or Cursor: it asks the agent to run the CLI, import CLAUDE.md, AGENTS.md and .cursorrules as memories, and turn on automatic recall. Use that after keys and spaces exist, not before.
6. What this is not
This is not Cursor’s own chat history, not Claude Projects, and not a replacement for git. Those tools still do their jobs. AgentVault holds durable facts you want every connected agent to be able to find. Keep secrets out of memory. If a key leaks, revoke it in the console. For the Claude app connector, the URL itself includes the key and should be treated like a password.
FAQ
- Do I need two AgentVault accounts?
- No. One account and one space can be used by many agents. Each human on a team should still have their own API key.
- Does this work with Windsurf and VS Code?
- Yes. The same endpoint and bearer token appear in the configs on https://useagentvault.com/docs/mcp.
- Why did Claude Code skip my server after I copied Cursor's JSON?
- Claude Code requires type http (or streamable-http) on a url entry. Cursor's documented remote shape does not use that field.
- Can I keep some memories private on a team?
- Yes. AgentVault documents private memories inside shared spaces that are visible only to their author, and personal spaces alongside team spaces.
- What if I only use one of the two tools?
- Connect only that tool. Shared memory becomes useful the first time a second client joins the same space.