> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Gentleman-Programming/engram/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor Setup

> Project-level MCP config for Cursor AI editor

<Note>
  **Prerequisite**: Install the `engram` binary first via [Homebrew](/installation#homebrew-macos-linux) or [binary download](/installation#download-binary).
</Note>

## Setup

Add to `.cursor/mcp.json` in your project (same path on all platforms):

```json theme={null}
{
  "mcpServers": {
    "engram": {
      "command": "engram",
      "args": ["mcp"]
    }
  }
}
```

<Steps>
  <Step title="Install engram binary">
    ```bash theme={null}
    brew install gentleman-programming/tap/engram
    ```
  </Step>

  <Step title="Create MCP config">
    Create `.cursor/mcp.json` in your project root:

    ```json theme={null}
    {
      "mcpServers": {
        "engram": {
          "command": "engram",
          "args": ["mcp"]
        }
      }
    }
    ```
  </Step>

  <Step title="Restart Cursor">
    Reload the window or restart Cursor.
  </Step>
</Steps>

## Adding the Memory Protocol (Recommended)

Add the Memory Protocol to `.cursorrules` file to teach the agent when to use memory.

Create or edit `.cursorrules` in your project root:

```markdown theme={null}
# Engram Persistent Memory

You have access to Engram persistent memory (mem_save, mem_search, mem_context).

- Save proactively after significant work (bugfixes, decisions, discoveries, patterns).
- After context resets, call mem_context to recover state.
- Before ending session, call mem_session_summary.
```

See [Memory Protocol](/concepts/memory-protocol) for the full text.

## Platform-Specific Notes

### Windows

Make sure `engram.exe` is in your `PATH`. Cursor resolves MCP commands from the system PATH.

Check:

```powershell theme={null}
where engram
```

If not found, add the directory containing `engram.exe` to your PATH.

### macOS

If you installed via Homebrew, `engram` is automatically in `PATH`:

```bash theme={null}
which engram
```

### Linux

If you installed via Homebrew:

```bash theme={null}
which engram
```

If you downloaded a binary, move it to `/usr/local/bin` or add its directory to `PATH`.

## Cursor Rules File

The `.cursorrules` file is Cursor's project-level instruction file. It's similar to:

* `.clauderules` (Claude Code)
* `.windsurfrules` (Windsurf)
* `CLAUDE.md` (Claude Code)
* `GEMINI.md` (Gemini CLI)

Anything you put in `.cursorrules` is injected into the agent's system prompt.

## Memory Protocol Behavior

With the Memory Protocol in `.cursorrules`, the agent:

* **Saves proactively** after bugfixes, decisions, discoveries, patterns
* **Searches reactively** when you say "remember" or "what did we do"
* **Searches proactively** when starting work that might overlap past sessions
* **Closes sessions** with `mem_session_summary` before saying "done"
* **Recovers state** after compaction with `mem_context`

## Troubleshooting

### MCP tools not showing up

Check that `.cursor/mcp.json` exists:

```bash theme={null}
cat .cursor/mcp.json
```

Verify the format matches the example above.

### Binary not found

Cursor can't find `engram` command:

```bash theme={null}
# Check PATH
echo $PATH

# Check binary location
which engram  # macOS/Linux
where engram  # Windows
```

If missing, install via [Homebrew](/installation#homebrew-macos-linux) or [binary download](/installation#download-binary).

### Agent doesn't use memory

Check that `.cursorrules` includes the Memory Protocol:

```bash theme={null}
cat .cursorrules
```

If missing, add the minimal version from the "Adding the Memory Protocol" section above.

## Next Steps

* Learn about the [Memory Protocol](/concepts/memory-protocol)
* Explore [MCP Tools](/features/mcp-tools)
* Set up [Git Sync](/features/git-sync) for team memory sharing
