Documentation

Getting Started

PersistMemory gives your AI persistent, searchable memory via the Model Context Protocol (MCP). Connect it to any MCP-compatible client in under a minute.

You need:

  • A PersistMemory account (sign up free)
  • Node.js 18+ installed
  • Any MCP-compatible client: Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, or Cline

Authentication: MCP connections use browser-based OAuth. On first connect, a browser window opens for you to sign in. Sessions last 20 days — no API keys needed for MCP setup.

Add this to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "persistmemory": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.persistmemory.com/mcp"
      ]
    }
  }
}

Restart Claude Desktop after saving. On first launch, a browser window opens for OAuth login. After authenticating, your session lasts 20 days.

Full Claude integration guide →

Add PersistMemory via the CLI:

Terminal
claude mcp add persistmemory --transport http --url https://mcp.persistmemory.com/mcp

Or add it manually to your MCP config:

.mcp.json
{
  "mcpServers": {
    "persistmemory": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.persistmemory.com/mcp"
      ]
    }
  }
}

A browser window opens on first use for OAuth authentication. Session lasts 20 days.

Full Claude integration guide →

Create a .cursor/mcp.json file in your project root:

.cursor/mcp.json
{
  "mcpServers": {
    "persistmemory": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.persistmemory.com/mcp"
      ]
    }
  }
}

Restart Cursor after saving. A browser window opens for OAuth authentication on first connection. Your session lasts 20 days.

Full Cursor integration guide →

Option 1 — User settings (applies to all projects):

Add to your VS Code settings.json:

settings.json
{
  "mcp": {
    "servers": {
      "persistmemory": {
        "command": "npx",
        "args": [
          "-y",
          "mcp-remote",
          "https://mcp.persistmemory.com/mcp"
        ]
      }
    }
  }
}

Option 2 — Workspace config (per-project, shareable with team):

.vscode/mcp.json
{
  "servers": {
    "persistmemory": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.persistmemory.com/mcp"
      ]
    }
  }
}

Reload VS Code after saving. A browser window opens for OAuth authentication on first connection. Each team member authenticates with their own PersistMemory account.

Full Copilot integration guide →

Open Windsurf Settings, go to the MCP section (or Cascade > MCP), and add this configuration:

Windsurf MCP Config
{
  "mcpServers": {
    "persistmemory": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.persistmemory.com/mcp"
      ]
    }
  }
}

Restart Windsurf after adding the config. A browser window opens for OAuth authentication on first connection. Session lasts 20 days.

Full Windsurf integration guide →

Open the Cline extension sidebar in VS Code, go to MCP Servers, and add a new server:

Cline MCP Server Config
{
  "mcpServers": {
    "persistmemory": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.persistmemory.com/mcp"
      ]
    }
  }
}

A browser window opens for OAuth authentication on first connection. Once connected, Cline will see PersistMemory's tools and can use them autonomously during tasks.

Full Cline integration guide →

Once connected, your AI client has access to these tools:

authenticate

Authenticate with PersistMemory via browser-based OAuth (20-day session)

create_space

Create a new memory space to organize memories by project or topic

list_spaces

List all memory spaces you have access to

switch_space

Switch to a different memory space by ID

get_current_space

Show which memory space is currently active

add_to_memory

Save a memory with a title and content to the current space

search_memory

Semantic search across all memories in the current space

publish_message

Publish a message to the current space's chat

fetch_messages

Retrieve recent messages from the current space's chat

Tip: Add a custom instruction to your AI client to encourage proactive memory use: "Before starting any task, search memory for relevant project context. After completing a task with new discoveries, store them as memories."

MCP Connections (Claude, Cursor, VS Code, Windsurf, Cline)

MCP connections authenticate automatically through browser-based OAuth. On first connection, a browser window opens where you sign in with your PersistMemory account. Sessions last 20 days, after which you simply re-authenticate by calling the authenticate tool.

REST API (curl, Python, ChatGPT, Gemini)

For direct API access outside of MCP clients, use your API key from the Settings page in your PersistMemory dashboard. Include it as a Bearer token:

Terminal
curl -X POST https://backend.persistmemory.com/mcp/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "authentication flow", "top_k": 5}'

Generate your API key at Settings → API Keys.

Base URL: https://backend.persistmemory.com

Authentication

POST/api/auth/signupCreate account
POST/api/auth/loginLogin (returns API key)
POST/api/auth/verify-emailVerify email address
POST/api/auth/forgot-passwordRequest password reset
POST/api/auth/reset-passwordReset password
POST/api/auth/googleGoogle OAuth login
GET/auth/meGet current user info

Spaces

GET/spacesList your spaces
POST/spacesCreate a new space
GET/api/spaces/allList all spaces with details
GET/api/spaces/with-messagesList spaces with recent messages
POST/api/spaces/mergeMerge two spaces

Memory

POST/mcp/addMemoryStore a memory (title + content)
POST/mcp/searchSemantic search memories
POST/mcp/ingestUrlIngest content from a URL
POST/mcp/uploadFileUpload and process a file

Messages

POST/mcp/publishMessagePublish a message to a space
GET/mcp/fetchMessagesFetch recent messages

Chat

POST/api/chatAI chat with memory context
GET/api/chatsList chat conversations
POST/api/chatsCreate a new chat
PATCH/api/chats/:idUpdate a chat
DELETE/api/chats/:idDelete a chat

API Keys

GET/api/user/apikeyGet your API key
POST/mcp/createApiKeyCreate a new API key
GET/mcp/listApiKeysList all API keys

All authenticated endpoints require Authorization: Bearer YOUR_API_KEY header.

Tools not appearing in client

Restart your client (Claude Desktop, Cursor, etc.) after adding the config. Make sure Node.js 18+ is installed. Check that npx is available in your terminal.

Authentication not opening browser

Call the authenticate tool from your AI client. This triggers the OAuth flow and opens a browser window. If the browser doesn't open automatically, check the tool response for the login URL.

Session expired

Sessions last 20 days. When a session expires, simply call the authenticate tool again to re-authenticate through the browser.

"Not authenticated" error

This means the OAuth flow hasn't completed. Call authenticate, complete the browser login, then try your action again.

npx command not found

Install Node.js 18+ from nodejs.org. After installation, restart your terminal and MCP client.