Overview
Cursor integrates with CEMS via:- MCP server (HTTP or stdio) for memory operations
- 3 hooks for profile injection, gate rules, and session tracking
- 5 skills for recall, remember, forget, share, and context
- 1 rule (always-on) that instructs the agent to search memory proactively
What Gets Installed
When you runcems setup --cursor, the installer creates:
Shared Configuration
MCP Configuration
The installer adds this block to~/.cursor/mcp.json:
Default (HTTP transport)
Self-hosted (stdio transport)
If you run your own CEMS server:Hooks
cems_session_start.py
Trigger: Session start Purpose: Injects user profile and foundation guidelines What it does:- Fetches user profile via
/api/memory/profile - Fetches foundation guidelines via
/api/memory/foundation(cached 15 min) - Detects project from git remote
- Injects context as
<cems-profile>and<cems-foundation>blocks - Sets
CEMS_SESSION_IDenvironment variable for other hooks
CEMS_API_URL(env or~/.cems/credentials)CEMS_API_KEY(env or~/.cems/credentials)
cems_agent_response.py
Trigger: After each agent response Purpose: Accumulates transcript for observer analysis What it does:- Reads
CEMS_SESSION_IDfrom environment (set bycems_session_start.py) - Appends agent response to
/tmp/cems-transcripts/{session_id}.jsonl - Limits each entry to 10K chars
cems_stop.py
Trigger: Session end Purpose: Signals observer daemon to finalize session summary What it does:- Reads session ID from environment
- Writes stop signal to
~/.cems/observer/signals/{session_id}.json - Observer daemon picks up signal and sends transcript to
/api/session/summarize
Skills
cems-recall
File:~/.cursor/skills/cems-recall/SKILL.md
Purpose: Search memories with project-scoped boosting
Usage:
The agent invokes this skill when the user asks to recall something or when it needs context.
Implementation:
- Detects project from
git remote get-url origin- SSH:
[email protected]:org/repo.git→org/repo - HTTPS:
https://github.com/org/repo.git→org/repo
- SSH:
- Calls
memory_searchMCP tool: - For truncated results, calls
memory_get:
query(required) - Natural language searchscope(default:"both") -"personal","shared", or"both"max_results(default: 10) - Max results (1-20)max_tokens(default: 4000) - Token budgetenable_graph(default: true) - Include related memoriesenable_query_synthesis(default: true) - Expand query with LLMproject(auto-detect) - Project ID for scoped boosting
cems-remember
File:~/.cursor/skills/cems-remember/SKILL.md
Purpose: Store personal memories with project context
Usage:
Invoked when the user says “remember this” or the agent discovers something worth persisting.
Implementation:
- Detects project from git remote
- Chooses category:
preferences,conventions,architecture,decisions,workflow,errors,learnings, orgeneral - Calls
memory_addMCP tool:
- User preferences and style choices
- Project conventions and naming patterns
- Architecture and infrastructure decisions
- Debugging insights and recurring solutions
- Workflow patterns and deployment processes
- Session-specific context (current task, temporary state)
- Information already in the codebase
- Build output or error messages being debugged right now
- Speculative conclusions from a single observation
cems-share
File:~/.cursor/skills/cems-share/SKILL.md
Purpose: Store team-wide memories
Same as cems-remember but with scope: "shared"
cems-forget
File:~/.cursor/skills/cems-forget/SKILL.md
Purpose: Delete or archive memories
Implementation:
Calls memory_forget MCP tool:
cems-context
File:~/.cursor/skills/cems-context/SKILL.md
Purpose: Show memory system status
Displays:
- Session ID
- Current project
- Recent memories count
- Observer daemon status
MCP Tools
CEMS exposes these MCP tools to Cursor:memory_search
Purpose: Search memories with semantic retrieval, graph traversal, and time decay Parameters:memory_add
Purpose: Store a memory (personal or shared scope) Parameters:memory_get
Purpose: Fetch full memory by ID (for truncated search results) Parameters:memory_forget
Purpose: Archive or permanently delete a memory Parameters:memory_update
Purpose: Update an existing memory’s content Parameters:memory_maintenance
Purpose: Run consolidation, summarization, or reindex jobs Parameters:Setup Verification
1. Check MCP config
cems server entry.
2. Check hooks
3. Check skills
4. Check credentials
5. Test MCP connection
In Cursor, open the MCP panel and verifycems server shows as connected.
6. Test search
In Cursor chat:cems-recall skill and call memory_search.
How It Works
On Session Start
cems_session_start.pyruns- Fetches profile and foundation guidelines
- Detects project from git remote
- Injects context into session
- Sets
CEMS_SESSION_IDenv var
During Session
- Agent consults always-on rule: “Search memory before starting tasks”
- Agent invokes
cems-recallskill - Skill detects project and calls
memory_searchMCP tool - Memories displayed to agent
- Agent uses memories to inform work
- When discoveries made, agent invokes
cems-rememberskill cems_agent_response.pylogs each response to transcript
On Session End
cems_stop.pywrites stop signal- Observer daemon reads transcript from
/tmp/cems-transcripts/{session_id}.jsonl - Sends to
/api/session/summarize - Server extracts high-level observations
- Observations stored as memories
Cursor Plugin (Alternative)
CEMS also has an official Cursor plugin available in the marketplace: Installation:- Search for “CEMS” in Cursor plugin marketplace
- Click “Add to Cursor”
- Set
CEMS_API_KEYenvironment variable - Restart Cursor
- MCP config (HTTP to
https://mcp-cems.chocksy.com/mcp) - Gate rule hooks for shell and MCP execution
- Skills for recall and remember
- Always-on rule for proactive memory usage
Troubleshooting
MCP tools not appearing
- Check MCP config:
cat ~/.cursor/mcp.json - Verify
CEMS_API_KEYenvironment variable is set - Restart Cursor
- Check MCP panel for connection errors
Skills not working
- Verify files exist:
ls ~/.cursor/skills/cems-*/ - Restart Cursor
- Try invoking directly: “Use the cems-recall skill to search for X”
Hooks not running
- Check hook files:
ls ~/.cursor/hooks/cems_*.py - Test manually:
- Check Python version:
python3 --version(needs 3.11+) - Check uv installed:
uv --version
No memories in search results
- Test CLI:
cems search "test query" - Check server connection:
cems health - Verify credentials:
cat ~/.cems/credentials - Check server logs if self-hosting
Next Steps
- Claude Code Integration - Deepest integration with 6 hooks
- Codex Integration - Command-based interface
- Goose Integration - MCP-only extension