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.
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.
2Auto-setup (recommended)
The fastest way is to run the Memstate setup command. It detects Cursor automatically:
npx @memstate/mcp setup
3Manual 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.
4Restart 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. 84.4% benchmark accuracy.