AgentID quickstart

Share project memory between Claude Code and Cursor

Save a project decision in Claude Code. Open a fresh Cursor session and retrieve that decision without pasting the old chat. Both clients connect to the same AgentID handle over MCP.

Before you start

Use Claude Code and the Cursor Agent CLI, signed in to their respective accounts. Create a scratch AgentID agent and save its MCP secret when it appears. If you use an existing agent, have its handle and MCP secret available. Use a harmless example decision. Your AgentID workspace can share memory with other agents on the same account, depending on its sharing settings.

The handle identifies the agent. The MCP secret grants access. In zsh, enter the secret through the hidden prompt below. Run both clients from this terminal so they inherit the variable. Keep the secret out of the config files, prompts, and commits.

read -rs 'AGENTID_MCP_TOKEN?AgentID MCP secret: '
export AGENTID_MCP_TOKEN
printf '\n'

Create an AgentID agent · Install Claude Code · Install Cursor Agent CLI

1. Connect Claude Code and save a decision

Open a scratch project and save the config below as .mcp.json in its root. If the file already exists, merge the agentid entry into its mcpServers object. Replace replace-with-agentid-handle with your handle, omitting the leading @.

{
  "mcpServers": {
    "agentid": {
      "type": "http",
      "url": "https://agentid.live/api/mcp/replace-with-agentid-handle",
      "headers": {
        "Authorization": "Bearer ${AGENTID_MCP_TOKEN}"
      }
    }
  }
}
claude --strict-mcp-config --mcp-config .mcp.json

In Claude Code, run /mcp and check that agentid is connected. Choose a unique snake_case key such as decision_preview_port_81. Replace the sample decision with your own harmless text. Paste this prompt and approve the write if asked.

Use the AgentID write_memory tool to save this entry.
Key: <your-unique-test-key>
Value: Use port 4317 for the demo because 3000 is reserved. Next, verify that the preview opens.
Show the tool result so I can confirm the write succeeded.

Check the tool result for a successful write before switching clients. Claude Code MCP documentation

2. Retrieve the decision in a fresh Cursor session

Add the entry below to .cursor/mcp.json in the same project, using the same AgentID handle. Merge it into mcpServers if the file already exists.

{
  "mcpServers": {
    "agentid": {
      "url": "https://agentid.live/api/mcp/replace-with-agentid-handle",
      "headers": {
        "Authorization": "Bearer ${env:AGENTID_MCP_TOKEN}"
      }
    }
  }
}
agent mcp list-tools agentid
agent

Confirm the tool list contains search_memory. Start a new Cursor session and give it only the key you saved. Approve the AgentID read if asked.

Call AgentID search_memory with query set to "<your-unique-test-key>".
Show the tool result. Return the value next to that exact key verbatim.
If the exact key is missing or the tool returns an error, show that result.

Compare the Cursor tool result with the value you saved in Claude Code. An exact match confirms that the two sessions could share that entry on demand. Cursor CLI MCP documentation

The Cursor editor also reads the project config. If you use the editor, make the environment variable available to the editor process, restart it, and check the server under Customize → MCPs before opening a new chat. Cursor editor MCP documentation

3. Check what crossed tools

This example retrieves one saved memory entry using the same handle in both clients. To pass work between distinct agents, use two handles on the same account and check which memory each can read. The sending agent calls handoff, and the receiving agent calls read_mission to see the next steps. AgentID protocol examples

To check activity separately, ask each client to call report_activity using its displayed tool schema. Give the save and retrieval distinct titles, then look for both in Agency.

Troubleshooting

AgentID is missing from the client
Run the client from the project root and check the config file name and JSON structure. In Cursor, run agent mcp list and enable agentid if it is disabled. Open a fresh session after correcting the config.
Authentication fails
Check that the handle in the URL matches the agent that issued the MCP secret. Confirm the client inherited AGENTID_MCP_TOKEN and that each config uses the interpolation syntax shown for that client. Avoid printing the variable to check it.
The read returns no entry
Check the successful write in Claude Code, the exact key in the Cursor tool call, and the handle in both URLs. Start a new Cursor session and retry the explicit read.
Agency shows no activity
Check that the client called report_activity and inspect its result. Activity reporting is best effort. Use the write and read tool results to verify recall.

Claude Code integration · Cursor integration · One-time setup help