Get persistent memory working in Cursor in under 2 minutes.
- Cursor IDE (latest version)
- Python 3.10+
- pipx installed (
pip install --user pipx && pipx ensurepath)
pipx install memorygraphMCPVerify installation:
memorygraph --versionOption A: Via Settings UI
- Open Cursor Settings (
Cmd/Ctrl + ,) - Navigate to Features > MCP
- Click Add Server
- Enter:
- Name:
memorygraph - Command:
memorygraph
- Name:
Option B: Via Configuration File
Create or edit .cursor/mcp.json in your project root:
{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"args": [],
"env": {}
}
}
}For global configuration (all projects), create ~/.cursor/mcp.json.
MCP servers require Cursor's Agent mode:
- Open Cursor Chat (
Cmd/Ctrl + L) - Click the mode selector (bottom of chat)
- Select Agent mode
Close and reopen Cursor to load the MCP server.
In Cursor chat (Agent mode), ask:
What memory tools do you have available?
You should see MemoryGraph tools like store_memory, search_memories, etc.
Try storing your first memory:
Store this for later: This project uses TypeScript with strict mode enabled
Then retrieve it:
What do you know about this project's TypeScript setup?
{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"args": ["--profile", "extended"]
}
}
}{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"env": {
"MEMORY_SQLITE_PATH": "/path/to/your/memory.db"
}
}
}
}{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"args": ["--profile", "extended", "--backend", "neo4j"],
"env": {
"MEMORY_NEO4J_URI": "bolt://localhost:7687",
"MEMORY_NEO4J_USER": "neo4j",
"MEMORY_NEO4J_PASSWORD": "your-password"
}
}
}
}- Ensure memorygraph is in your PATH:
which memorygraph
- If not found, run
pipx ensurepathand restart your terminal - Try using the full path in config:
{ "command": "/Users/yourname/.local/bin/memorygraph" }
MCP tools only work in Agent mode. If you don't see the tools:
- Switch from "Chat" or "Composer" to "Agent" mode
- The mode selector is at the bottom of the chat panel
- Check Cursor's MCP server status in Settings > Features > MCP
- Look for error messages in the server status
- Test the server manually:
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}},"id":1}' | memorygraph
On macOS, you may need to allow terminal access:
- System Preferences > Security & Privacy > Privacy > Full Disk Access
- Add Cursor to the list
- Use Agent mode for memory operations - Regular chat mode doesn't have MCP access
- Store patterns as you discover them - Ask Cursor to remember useful patterns
- Query before implementing - Check if you've solved similar problems before
- Use project-scoped config - Keep
.cursor/mcp.jsonin your repo for team sharing
Add this to .cursorrules or your project's rules file for automatic memory usage:
## Memory Protocol
### REQUIRED: Before Starting Work
You MUST use `recall_memories` before any task. Query by project, tech, or task type.
### REQUIRED: Automatic Storage Triggers
Store memories on ANY of:
- **Git commit** → what was fixed/added
- **Bug fix** → problem + solution
- **Version release** → summarize changes
- **Architecture decision** → choice + rationale
- **Pattern discovered** → reusable approach
### Timing Mode (default: on-commit)
`memory_mode: immediate | on-commit | session-end`
### Memory Fields
- **Type**: solution | problem | code_pattern | fix | error | workflow
- **Title**: Specific, searchable (not generic)
- **Content**: Accomplishment, decisions, patterns
- **Tags**: project, tech, category (REQUIRED)
- **Importance**: 0.8+ critical, 0.5-0.7 standard, 0.3-0.4 minor
- **Relationships**: Link related memories when they exist
Do NOT wait to be asked. Memory storage is automatic.File locations:
- Project-specific:
.cursorrulesin project root - Global:
~/.cursor/rulesor Cursor Settings
Works with: Cursor AI (all versions with MCP support) Transport: stdio Profiles: core (9 tools), extended (11 tools)