Drop-in Cursor IDE rules + MCP server preset that wire LedgerMem into your AI coding workflow.
Result: Cursor automatically recalls relevant project memory before generating, and saves design decisions back as you make them.
# From your project root
curl -fsSL https://raw.githubusercontent.com/ledgermem/ledgermem-cursor-rules/main/install.sh | bashWhat that does:
- Drops
.cursor/rules/ledgermem.mdcinto your project - Adds an
mcpServersentry to~/.cursor/mcp.json(or creates the file) - Verifies
npx -y @ledgermem/mcp-serveris reachable
mkdir -p .cursor/rules
curl -fsSL -o .cursor/rules/ledgermem.mdc https://raw.githubusercontent.com/ledgermem/ledgermem-cursor-rules/main/.cursor/rules/ledgermem.mdcThen add to ~/.cursor/mcp.json:
{
"mcpServers": {
"ledgermem": {
"command": "npx",
"args": ["-y", "@ledgermem/mcp-server"],
"env": {
"LEDGERMEM_API_KEY": "${env:LEDGERMEM_API_KEY}",
"LEDGERMEM_WORKSPACE_ID": "${env:LEDGERMEM_WORKSPACE_ID}"
}
}
}
}Then in your shell:
export LEDGERMEM_API_KEY=lm_live_...
export LEDGERMEM_WORKSPACE_ID=ws_...| Rule | When it fires | What it does |
|---|---|---|
| Recall before code | Before any non-trivial generation | Calls memory_search for relevant prior decisions |
| Save decisions | When user accepts an architectural choice | Calls memory_add with the decision + rationale |
| No repeated questions | When asking the user something | Searches memory first to avoid asking twice |
| Stack consistency | Before suggesting a library | Checks memory for already-chosen libraries in this project |
See .cursor/rules/ledgermem.mdc for the full rule text.
Cursor inherits .cursor/rules/ and MCP config — these also work in:
- Cursor (primary)
- Windsurf (MCP only; uses
~/.codeium/windsurf/mcp_config.json) - Cline (MCP only; uses
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json)
MIT