twin memory

VS Code

Add twin memory to VS Code's agent mode as an HTTP MCP server, with the key asked for once and kept by VS Code.

Add the server

In the workspace, create .vscode/mcp.json. The inputs entry makes VS Code ask for the key the first time the server starts and keep it in its secret storage, so the key is never in the file:

.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "twin-key",
      "description": "twin memory API key",
      "password": true
    }
  ],
  "servers": {
    "twin-memory": {
      "type": "http",
      "url": "https://api.twinmemory.dev/v1/mcp",
      "headers": {
        "Authorization": "Bearer ${input:twin-key}",
        "X-Twin-Account": "user_42"
      }
    }
  }
}

To add the server for every workspace, run MCP: Open User Configuration from the Command Palette and add the same entry there.

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.

Newer VS Code builds

VS Code's newer MCP docs mark .vscode/mcp.json and the user mcp.json as deprecated in the guided setup, in favour of a portable .mcp.json with mcpServers. That format does not support ${input:...}, so keep the file above if you want VS Code to prompt for the key. Servers that use ${input:...} are also not forwarded to Copilot harness sessions.

Check it

Start the server from the mcp.json editor or the MCP view and enter your key when asked. Then, in agent mode, ask for memory_overview: it answers with the directories and counts of user_42's memory.

If the server does not start, see Troubleshooting.


Sources checked 2026-10-21: code.visualstudio.com/docs/agents/reference/mcp-configuration, code.visualstudio.com/docs/copilot/customization/mcp-servers.

On this page