Skip to content

Menu

Cursor Cheat Sheet: Shortcuts, Rules, MCP and CLI

Checked against Cursor Cursor docs and agent CLI as of 2026-11-28 on 28 November 2026. Each section links to the official docs it was checked against.

A quick reference for people who live in Cursor: editor shortcuts, project rules, MCP config and the agent CLI. Everything was checked against cursor.com/docs on 28 Nov 2026. Cursor doesn't print a version on these pages, so the date is the pin. Shortcuts are the Mac ones the docs list; on Windows and Linux, Cmd is usually Ctrl.

When to use what

Pick the mode by how much you want the model to touch. Ask mode is read-only and good for learning a codebase. Plan mode makes the agent lay out its approach and ask questions first, which saves you from reverting a large wrong diff. Agent mode is the default and edits freely, so use it once you know what you want.

For rules, use the narrowest trigger that works. alwaysApply: true costs context in every chat, so keep it for a handful of short, truly global rules. Rules for one stack (say, your React conventions) should use globs so they only load when those files are in play. A good description lets the agent pull in a rule when it judges it relevant, and manual rules you @-mention are right for rare procedures like a release checklist. If you also use other agents, an AGENTS.md in the root is the portable choice, since Copilot and others read it too.

Put MCP servers that the whole team needs in .cursor/mcp.json and commit it, with secrets pulled from ${env:NAME}. Personal servers go in ~/.cursor/mcp.json. Our MCP config generator writes the JSON and the Cursor MCP setup post walks through each step. Use the agent CLI with -p for scripted jobs; for interactive work the editor is still faster.

The docs list Mac keys only. Check your own bindings under Keyboard Shortcuts before teaching them to a Windows team.

Cmd+I

Toggle the agent side panel

From the docs, not run by us
Cmd+N

Start a new chat in the agent panel

From the docs, not run by us
Cmd+Shift+L

Add the current selection to the chat as context

From the docs, not run by us
Cmd+.

Open the mode menu to switch between Agent, Ask and Plan

From the docs, not run by us
Shift+Tab

Rotate through agent modes while the chat input has focus

From the docs, not run by us
Cmd+/

Cycle to the next AI model in the picker

From the docs, not run by us
Cmd+Return

Accept all suggested changes from the agent

From the docs, not run by us
Cmd+Shift+Backspace

Reject suggested changes, or cancel a generation in progress

From the docs, not run by us
Cmd+[ / Cmd+]

Jump to the previous or next chat

From the docs, not run by us
Tab

Accept the current Tab autocomplete suggestion

From the docs, not run by us

Precedence is Team Rules, then Project Rules, then User Rules, and every rule that applies is merged into the prompt.

.cursor/rules/*.mdc

Project rules kept in version control; subfolders are allowed

From the docs, not run by us
alwaysApply: true

Load the rule in every chat; globs and description are then ignored

From the docs, not run by us
globs: src/**/*.ts, src/**/*.tsx

Attach the rule automatically when matching files are in context (comma-separated)

From the docs, not run by us
description: ...

Summary the agent reads to decide whether the rule is relevant

From the docs, not run by us
@my-rule

Pull a manual rule into the current chat by mentioning it

From the docs, not run by us
/create-rule

Ask the agent to write a new rule file into .cursor/rules

From the docs, not run by us
AGENTS.md

Plain markdown instructions with no frontmatter; nested files win over the root one

From the docs, not run by us
Customize > Rules

Where personal User Rules live and where Add Rule creates a project rule

From the docs, not run by us

Hosted Cloud Agents don't read ~/.cursor/mcp.json; configure their servers at cursor.com/agents instead. MCP logs are in the Output panel (Cmd+Shift+U, then "MCP Logs").

.cursor/mcp.json

Project MCP servers, best committed so the team shares them

Try it: MCP Config GeneratorFrom the docs, not run by us
~/.cursor/mcp.json

Global MCP servers available in every project you open

From the docs, not run by us
{"mcpServers": {"name": {...}}}

Root key Cursor expects; each server is a named entry under it

Try it: MCP Config ValidatorFrom the docs, not run by us
"type": "stdio", "command", "args"

Fields for a local server that Cursor starts as a process

From the docs, not run by us
"envFile": ".env"

Load env vars for a stdio server from a file (not for remote servers)

Try it: env-to-jsonFrom the docs, not run by us
"url", "headers"

Fields for a remote HTTP or SSE server, with optional auth headers

From the docs, not run by us
${env:NAME} / ${workspaceFolder}

Interpolate an env var or the project root into command, args, env, url or headers

From the docs, not run by us

Install on macOS, Linux or WSL with curl https://cursor.com/install -fsS | bash. The binary is called agent.

agent "PROMPT"

Start an interactive agent session with a first prompt

From the docs, not run by us
agent -p "PROMPT" --output-format json

Run headless and print a JSON result (text and stream-json also work)

From the docs, not run by us
--model MODEL / --list-models

Choose the model for the run, or list the ones your account can use

From the docs, not run by us
--mode plan|ask (or --plan)

Start in Plan or read-only Ask mode instead of Agent

From the docs, not run by us
--resume [chatId] / --continue

Pick up an earlier chat by ID, or carry on from the last one

From the docs, not run by us
-f, --force (alias --yolo)

Run commands without asking for approval each time

From the docs, not run by us
-w, --worktree [name]

Do the work in a separate git worktree so your checkout stays clean

From the docs, not run by us
agent mcp list

Show configured MCP servers; enable, disable and list-tools also exist

From the docs, not run by us
agent ls

List previous chats so you can resume one

From the docs, not run by us
agent generate-rule

Create a project rule from the terminal (alias: agent rule)

From the docs, not run by us

Worked example: Add a TypeScript rule and a project MCP server, then check both from the CLI

Goal: every agent working on src/ follows your error-handling style, and the whole team gets the same GitHub MCP server without committing a token.

# .cursor/rules/typescript-errors.mdc
---
description: Error handling conventions for TypeScript source
globs: src/**/*.ts, src/**/*.tsx
alwaysApply: false
---
Throw typed errors from src/lib/errors.ts. Never swallow an error in an empty catch.
{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": { "Authorization": "Bearer ${env:GITHUB_TOKEN}" }
    }
  }
}
agent mcp list
agent -p "Which project rules apply when you edit src/api/user.ts?" --mode ask

The rule only loads when a TypeScript file under src/ is in context, so it costs nothing in chats about docs or CI. Because alwaysApply is false and globs is set, it behaves as an "Apply to Specific Files" rule. The JSON goes in .cursor/mcp.json and is safe to commit, since the token is read from your shell with ${env:GITHUB_TOKEN} at load time. agent mcp list should show the github server; if it doesn't, the Output panel's MCP Logs usually names the JSON error. The Ask-mode question is a cheap way to confirm the rule is matched without letting the agent edit anything. We checked the field names against the docs but didn't run this setup ourselves, and the GitHub server URL is just an example.

Common mistakes

  • Saving a rule as .cursor/rules/style.md and wondering why it never applies

    Project rules must use the .mdc extension; rename the file and add frontmatter.

  • Setting alwaysApply: true on every rule so nothing gets missed

    That fills every chat with context it doesn't need; use globs or a clear description and keep always-on rules short.

  • Pasting an API key straight into a committed .cursor/mcp.json

    Reference it with ${env:NAME} or point a stdio server at an envFile that git ignores.

  • Using VS Code's servers root key in Cursor's mcp.json

    Cursor reads mcpServers; run the file through an MCP config validator when you copy it between clients.

  • Expecting a Cloud Agent to see servers from ~/.cursor/mcp.json

    Hosted agents ignore the global file; add those servers at cursor.com/agents or as team servers.

  • Running agent -p with --force in a repo with uncommitted work

    Commit or stash first, or add -w so the agent works in its own git worktree.