twin memory

Cursor

Add twin memory to Cursor as a remote MCP server in mcp.json, with your key read from the environment.

Add the server

Cursor reads MCP servers from two files:

  • ~/.cursor/mcp.json, for every project;
  • .cursor/mcp.json in a project, for that project.

A server with a url is a remote server. Add twin memory with its two headers:

~/.cursor/mcp.json
{
  "mcpServers": {
    "twin-memory": {
      "url": "https://api.twinmemory.dev/v1/mcp",
      "headers": {
        "Authorization": "Bearer ${env:TWIN_MEMORY_API_KEY}",
        "X-Twin-Account": "user_42"
      }
    }
  }
}

${env:TWIN_MEMORY_API_KEY} is replaced with the TWIN_MEMORY_API_KEY environment variable, so the key is not written into the file. Set it in the environment Cursor starts from:

Terminal
export TWIN_MEMORY_API_KEY="tm_..."

Use a read key if the agent should only search and read: it cannot write or erase. Use a read and write key if the agent should save what it learns: the server then lists memory_add too.

Check it

Open Cursor's MCP settings. twin-memory should be listed with its tools. Ask the agent to call memory_overview: it answers with the directories and counts of user_42's memory.

If no tools are listed, see Troubleshooting.


Sources checked 2026-10-21: cursor.com/docs/context/mcp.

On this page