Blog/Tutorial
2 minute setup

How to Add Memory to Cursor

Cursor is a powerful AI coding editor, but like all LLM-based tools, it forgets everything when you close a session. This guide shows you how to give Cursor persistent, structured memory using Memstate MCP — so it remembers your architecture decisions, preferences, and project context across every session.

March 23, 2026·5 min read·Memstate AI

Why Cursor Forgets Your Context

Every Cursor session starts fresh. The AI has no memory of what you discussed yesterday — the database schema you agreed on, the naming conventions you established, the bugs you fixed and why. You end up re-explaining context in every session, wasting time and getting inconsistent results.

Cursor supports the Model Context Protocol (MCP), which lets you connect external tools and data sources to the AI. By connecting Memstate via MCP, Cursor can store and retrieve structured memories — giving it persistent context across sessions.

What You Need

  • Cursor 0.43+ (with MCP support)
  • Node.js 18+ installed
  • A free Memstate AI account (no credit card required)

Step-by-Step Setup

1Create a free Memstate account

Sign up at memstate.ai — free, no credit card. Go to Dashboard → API Keys and create a new key. Copy it.

2Install via Cursor Marketplace (Recommended)

The easiest way to get started is using the official Cursor plugin. Head over to our Cursor Marketplace Plugin Page.

Important: You need to install both the MCP Server and the Rule listed on that page. The Rule is what tells Cursor exactly when to use the memory tools (e.g., fetching context before starting a task, and saving summaries after finishing).

3Alternative: CLI Auto-setup

If you prefer the terminal, you can run our setup command. It detects Cursor automatically:

npx @memstate/mcp setup

4Alternative: Manual setup via Cursor Settings

Alternatively, open Cursor and go to Settings → Features → MCP Servers. Click Add new MCP server and enter:

{
  "mcpServers": {
    "memstate": {
      "command": "npx",
      "args": ["-y", "@memstate/mcp"],
      "env": {
        "MEMSTATE_API_KEY": "your-api-key-here"
      }
    }
  }
}

You can also add this to ~/.cursor/mcp.json for global access across all projects, or to .cursor/mcp.json in a specific project directory for project-scoped memory.

5Restart Cursor and verify

Restart Cursor. In the chat panel, you should see Memstate listed as an available MCP tool. You can verify by typing:

What MCP tools do you have access to?

Cursor should list the Memstate memory tools: store_memory, recall_memory, search_memories, and more.

Project-Level Memory with memstate init

For coding projects, you can also set up project-level instruction files that tell Cursor (and other agents) how to use Memstate for your specific project:

npx @memstate/mcp init

This creates AGENTS.md, .cursorrules, and CLAUDE.md in your project directory with instructions for how the AI should use memory in this project.

Give Cursor memory now

Free forever. No credit card. 5.3x more accurate than Mem0 on fact recall in our open-source benchmark.