Skip to content

Cursor Instructions

Rahil Pirani edited this page Sep 7, 2026 · 3 revisions

Cursor Instructions

Cursor can use Second Brain through MCP and through Cursor Rules that tell the agent to recall at the start of every chat and remember important context as you work.

1. Connect Second Brain over MCP

Add your Worker as an MCP server in Cursor Settings → MCP:

https://YOUR-WORKER-URL/mcp

Use OAuth when Cursor offers it. On first use, complete the hosted sign-in page with your owner password or team member token.

If OAuth is not available, use a bearer header in your MCP config — never put a token in the URL. See Connect to AI Clients.

2. Install the agent instructions

Cursor has no single global instructions file like Claude Code's CLAUDE.md. The supported approach is a project or user rule with alwaysApply: true.

Option A — User rule (every project)

Copy the rule template from the repository:

mkdir -p ~/.cursor/rules
curl -fsSL https://raw.githubusercontent.com/rahilp/second-brain-cloudflare/main/.cursor/rules/second-brain-memory.mdc \
  -o ~/.cursor/rules/second-brain-memory.mdc

Optional: keep the full instruction text handy for reference:

curl -fsSL https://raw.githubusercontent.com/rahilp/second-brain-cloudflare/main/AI_Instructions/CURSOR_INSTRUCTIONS.md \
  -o ~/.cursor/CURSOR_INSTRUCTIONS.md

Reload Cursor after copying the rule.

Option B — Project rule (one repository)

If you cloned second-brain-cloudflare, the rule already lives at .cursor/rules/second-brain-memory.mdc. Cursor picks it up for that workspace automatically.

For your own projects, copy that file into .cursor/rules/ at the project root.

Option C — Paste the full block manually

Open AI_Instructions/CURSOR_INSTRUCTIONS.md and paste it into Cursor Settings → Rules → User Rules, or into a project rule with Always apply enabled.

The repository file is the canonical source — update from there when Second Brain releases new tools or team-edition behaviour.

3. Optional CLI fallback

If MCP tools are missing in a session but the brain CLI is configured, the rule tells the agent to run:

brain recall "User wants to X about Y — what should I know?"
brain remember "condensed summary" --tags work,my-project

Install with npm install -g second-brain-cf-cli. On first run, brain prompts for your Worker URL and token.

What the instructions require

Every session:

  1. Recall first — intent-framed query, not bare keywords.
  2. Remember silently — user context, decisions, tasks, and important agent conclusions (tagged cursor-response plus project tags).
  3. Recall before recommending or re-asking — avoid duplicate advice.
  4. Never use Cursor's built-in memory for facts that belong in Second Brain.

On team brains, memory tools accept workspace: personal | company and, for multi-team brains, a team id from list_teams. See Team Setup.

Troubleshooting

  • MCP connected but no remember/recall tools listed — Cursor may load tools lazily. Ask the agent to run recall once; see Troubleshooting.
  • OAuth errors in Cursor — remove the MCP entry, re-add the base /mcp URL, authenticate again.
  • Rule not applying — confirm alwaysApply: true in the rule frontmatter and reload the window.

See also

Clone this wiki locally