MCPSetup GuideDevOps

MCP Server Setup Guide: Connect Any AI Tool to Persistent Memory

12 min readBy Mohammad Saquib Daiyan

The Model Context Protocol (MCP) is the universal standard for connecting AI tools to external data sources and services. If you want to give your AI assistant persistent memory, file processing, or access to custom tools, MCP is how you do it. This guide walks you through setting up PersistMemory as an MCP server and connecting it to every major AI tool: Claude Desktop, Claude Code, Cursor, VS Code with Copilot, Windsurf, Cline, and more. By the end, every AI tool in your workflow will share a single, persistent memory layer.

What is MCP? A Quick Primer

MCP (Model Context Protocol) is an open standard created by Anthropic for connecting AI models to external systems. It defines a client-server architecture where AI applications (clients) communicate with external services (servers) through a standardized protocol. The server exposes capabilities as tools (functions the AI can call), resources (data the AI can read), and prompts (pre-built interaction templates).

The protocol supports two transport mechanisms: stdio (standard input/output, where the server runs as a local process) and HTTP with Server-Sent Events (SSE) for remote servers. PersistMemory uses HTTP transport, which means you do not need to install or run anything locally. Your AI tools connect directly to the PersistMemory cloud endpoint, and the memory server handles everything server-side.

MCP has been adopted by virtually every major AI tool. Claude Desktop and Claude Code have native MCP support from Anthropic. Cursor integrated MCP into its AI features. VS Code supports MCP through Copilot and extensions. Windsurf, Cline, Zed, and many other tools have added MCP support. This broad adoption makes MCP the clear choice for building AI integrations that work everywhere.

Prerequisites

You need three things before starting. First, Node.js 18 or later. The mcp-remote bridge tool requires Node.js to run. Check your version with node --version. If you need to install or update, use your platform's package manager or download from nodejs.org.

Second, a PersistMemory account. Go to persistmemory.com and create a free account. Once logged in, you are ready to connect. MCP connections authenticate automatically through browser-based OAuth login.

Third, at least one MCP-compatible AI tool installed on your system. This guide covers Claude Desktop, Claude Code, Cursor, VS Code with Copilot, Windsurf, and Cline. The general pattern applies to any MCP client.

Setup 1: Claude Desktop

Claude Desktop is Anthropic's native desktop application for Claude. It has deep MCP integration and is one of the best ways to use Claude with external tools. The configuration is managed through a JSON file.

Find the Configuration File

The config file location depends on your operating system:

# macOS
~/Library/Application Support/Claude/claude_desktop_config.json

# Windows
%APPDATA%\Claude\claude_desktop_config.json

# Linux
~/.config/Claude/claude_desktop_config.json

Add PersistMemory Server

Open the config file in your text editor. If it does not exist, create it. Add the following configuration:

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

Save the file and restart Claude Desktop. On first launch, a browser window will open for you to log in with your PersistMemory account. This is a one-time OAuth authentication — your session lasts 20 days. You should see the PersistMemory tools appear when you click the hammer icon in the chat input area.

Verify the Connection

Type a message like "What memory tools do you have access to?" Claude should list the PersistMemory tools: store_memory, search_memory, list_memories, and others. If you see these, the connection is working. Try storing a test memory: "Remember that this is a test memory from the setup guide."

Setup 2: Claude Code (Terminal)

Claude Code is Anthropic's CLI tool for developers. It runs in your terminal and has native MCP support with a simple command-line interface for managing servers.

# Add PersistMemory to Claude Code
claude mcp add persistmemory \
  --transport http \
  --url https://mcp.persistmemory.com/mcp

# Verify the server was added
claude mcp list

# You should see:
# persistmemory: connected (http)

# To remove later if needed
claude mcp remove persistmemory

That is the entire setup for Claude Code. The server persists across sessions and terminal restarts. Every Claude Code conversation will now have access to your PersistMemory tools. You can scope the server to a specific project by adding the --scope project flag, which stores the configuration in the current directory's .claude/ folder instead of globally.

Setup 3: Cursor

Cursor is the AI-first code editor built on VS Code. It has excellent MCP support integrated directly into its AI features. You can add MCP servers through the Cursor settings UI.

# Option 1: Through Cursor Settings
# 1. Open Cursor Settings (Cmd+Shift+P > "Cursor Settings")
# 2. Navigate to "MCP" section
# 3. Click "Add MCP Server"
# 4. Enter:
#    Name: persistmemory
#    Type: command
#    Command: npx -y mcp-remote https://mcp.persistmemory.com/mcp

# Option 2: Edit .cursor/mcp.json in your project root
{
  "mcpServers": {
    "persistmemory": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.persistmemory.com/mcp"
      ]
    }
  }
}

After adding the server, Cursor's AI features (Composer, Chat, and inline completions) will have access to PersistMemory tools. You can tell Cursor's AI to search your memory for project context, store important decisions, and maintain continuity across coding sessions.

Setup 4: VS Code with GitHub Copilot

VS Code supports MCP through the GitHub Copilot extension. The configuration goes in your VS Code settings, either at the user level or the workspace level.

// .vscode/settings.json (workspace level)
// or User Settings (Cmd+Shift+P > "Preferences: Open User Settings (JSON)")
{
  "mcp": {
    "servers": {
      "persistmemory": {
        "command": "npx",
        "args": [
          "-y",
          "mcp-remote",
          "https://mcp.persistmemory.com/mcp"
        ]
      }
    }
  }
}

After saving the settings, reload VS Code. Copilot Chat will now have access to PersistMemory tools. You can use the agent mode in Copilot Chat to interact with your memory: ask it to search for project context, store coding patterns, or recall decisions from previous sessions.

Setup 5: Windsurf

Windsurf (formerly Codeium) is another AI-powered editor with MCP support. The configuration follows a similar pattern to other tools.

# Windsurf MCP configuration
# Location: ~/.windsurf/mcp.json (or via Windsurf Settings > MCP)
{
  "mcpServers": {
    "persistmemory": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.persistmemory.com/mcp"
      ]
    }
  }
}

Setup 6: Cline

Cline is a popular VS Code extension that provides autonomous AI coding capabilities. It supports MCP servers through its settings panel.

# Cline MCP configuration
# 1. Open VS Code
# 2. Open Cline sidebar (click the Cline icon)
# 3. Click the settings gear icon
# 4. Navigate to "MCP Servers"
# 5. Click "Add Server" and enter:

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

Cline will now use PersistMemory tools during autonomous coding sessions. This is particularly powerful because Cline runs multi-step tasks that benefit enormously from persistent memory. It can recall your project's architecture, coding conventions, and previous decisions while working autonomously.

Using the REST API Directly

If you want to integrate PersistMemory into custom applications, scripts, or AI agents that do not support MCP, you can use the REST API directly. The API provides the same capabilities as the MCP server: storing memories, searching, listing, and deleting.

# Store a memory
curl -X POST https://backend.persistmemory.com/mcp/addMemory \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "space": "acme-dashboard",
    "title": "Tech stack",
    "text": "Project uses Next.js 16 with App Router"
  }'

# Search memories
curl -X POST https://backend.persistmemory.com/mcp/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"space": "acme-dashboard", "q": "what framework does the project use", "top_k": 5}'

# List recent messages in a space
curl "https://backend.persistmemory.com/mcp/fetchMessages?space=acme-dashboard&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Delete a space
curl -X DELETE https://backend.persistmemory.com/spaces/acme-dashboard \
  -H "Authorization: Bearer YOUR_API_KEY"

Troubleshooting Common Setup Issues

Tools Not Appearing

If the PersistMemory tools do not appear after configuration, check these common issues. Verify your JSON configuration is valid (use a JSON validator). Make sure Node.js is installed and in your system PATH by running which npx in your terminal. Completely restart the AI tool (not just reload). Check that you completed the OAuth login when the browser window opened.

Slow First Connection

The first time you connect, npx downloads the mcp-remote package, which can take 10 to 30 seconds. Subsequent connections use the cached package and are much faster. To eliminate this delay entirely, install the package globally:

# Install globally for faster startup
npm install -g mcp-remote

# Then update your config to use the global version
# Change "command": "npx" to "command": "mcp-remote"
# And remove "-y" from args

Authentication Errors

If you see authentication errors, make sure you completed the OAuth login when the browser window opened. You can re-trigger authentication by running npx mcp-remote https://mcp.persistmemory.com/mcp directly in your terminal. If your session has expired (sessions last 20 days), simply restart the connection and log in again.

Connection Timeout

If the connection times out, check your network connectivity. If you are behind a corporate firewall or VPN, ensure that outbound HTTPS connections to mcp.persistmemory.com are allowed. Some corporate networks block non-standard HTTPS endpoints. Contact your network administrator if needed.

Best Practices for Multi-Tool Memory

When using the same PersistMemory account across multiple AI tools, keep these practices in mind. Use consistent namespaces: if you create a namespace called "acme-project" in Claude, use the same name in Cursor. This ensures all tools share the same memory space.

Be mindful of concurrent writes. If you are using Claude Desktop and Cursor simultaneously on the same project, both tools might try to store memories at the same time. PersistMemory handles this gracefully with atomic writes, but you might end up with duplicate memories. Periodically review and deduplicate your memory store.

Set up tool-specific instructions. In Claude Desktop, add to your system prompt: "You have access to PersistMemory. Always search memory before answering project-specific questions." In Cursor, add similar instructions to your Cursor Rules file. This ensures each tool proactively uses memory rather than waiting for explicit commands.

Conclusion

Setting up PersistMemory as an MCP server takes just a few minutes per tool, and the result is transformative: a single, persistent memory layer that works across every AI tool in your development workflow. Claude, Cursor, Copilot, Windsurf, Cline, and any other MCP-compatible tool all share the same memories, creating a unified AI experience where context follows you everywhere. No more re-explaining your project to each tool. No more losing context between sessions. Just persistent, intelligent memory that makes every AI interaction more productive.

Connect your AI tools to persistent memory today

Sign up for PersistMemory and follow this guide to connect every AI tool in your workflow. Free to start, no credit card required.