Use Palimem with Cursor
Connect Palimem to Cursor using the ai-memory connect cursor helper. The helper writes a valid MCP entry to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-level).
Prerequisites
Section titled “Prerequisites”- Cursor ≥ 0.40 (MCP support required)
- Node.js 18+
- Repository cloned and Node dependencies installed:
Terminal window cd app && npm install
Recommended install
Section titled “Recommended install”From your repository root:
node app/scripts/ai-memory.js connect cursor \ --project-root "$(pwd)" \ --data-dir .ai-memory/dataThis writes the memory-service entry to ~/.cursor/mcp.json (global config). Cursor picks up the change on next restart.
Config block
Section titled “Config block”The committed sample lives at examples/cursor/.cursor/mcp.json:
{ "mcpServers": { "memory-service": { "command": "node", "args": ["/absolute/path/to/repo/app/scripts/memory-service-mcp.js"], "env": { "MEMORY_SERVICE_DATA_DIR": "/absolute/path/to/repo/.ai-memory/data" } } }}Use absolute paths in args and MEMORY_SERVICE_DATA_DIR. The ai-memory connect cursor helper resolves these automatically.
Project-level config
Section titled “Project-level config”Cursor also supports a per-project .cursor/mcp.json. Write both global and project config:
node app/scripts/ai-memory.js connect cursor \ --project-root "$(pwd)" \ --project-config .cursor/mcp.json \ --data-dir .ai-memory/dataVerification
Section titled “Verification”- Restart Cursor (or use Command Palette → Reload MCP servers).
- Ask the agent to call
tools/list, thenmemory_statuswith scoperepositoryand your project namespace.
tools/list — expect 11 tools, including memory_query_temporal and memory_audit_export.
memory_status — expect ok: true, wal_high_water_seq, semantic_units_in_sync: true, and index_status.state: "current".
Agent prompt
Section titled “Agent prompt”Paste this into your Cursor chat to configure Palimem:
Set up Palimem as governed local memory for this Cursor project.
- Project: Palimem (spec v1.7.0)- Run: node app/scripts/ai-memory.js connect cursor --project-root "$(pwd)" --data-dir .ai-memory/data- Verify: call tools/list (11 tools), then memory_status — expect ok and index_status current
Use local data directory .ai-memory/data. Do not enable cloud services.CLI options
Section titled “CLI options”| Flag | Purpose |
|---|---|
--global-config PATH |
Override global mcp.json path (default: ~/.cursor/mcp.json) |
--project-config PATH |
Also write project .cursor/mcp.json |
--project-root PATH |
Repo root for resolving script paths (default: $PWD) |
--data-dir PATH |
MEMORY_SERVICE_DATA_DIR resolved to absolute (default: .ai-memory/data) |
--replace |
Overwrite existing memory-service entry |
--dry-run |
Print merged JSON without writing |
Troubleshooting
Section titled “Troubleshooting”MCP server not listed in Cursor
Restart Cursor after writing the config. Cursor reads mcp.json only on startup, not dynamically.
ENOENT on memory-service-mcp.js
The Node wrapper is not installed. Run:
cd app && npm installExisting entry refused
If a previous memory-service entry exists, re-run with --replace:
node app/scripts/ai-memory.js connect cursor \ --project-root "$(pwd)" --data-dir .ai-memory/data --replaceTools show 9 instead of 11
Pull the latest main and reinstall. memory_query_temporal and memory_audit_export were added in spec v1.6.0 and are present in v1.7.0.
Seed memory (optional)
Section titled “Seed memory (optional)”Pre-load memory from Markdown files:
python3 app/import_markdown.py \ --data-dir .ai-memory/data \ examples/markdown/USER.md.sample \ examples/markdown/MEMORY.md.sampleNext steps
Section titled “Next steps”- Palimpsest model — how supersession and layered memory work
- Scopes — user, session, and repository memory
- MCP tools reference — all 11 tools with arguments