← Back to cookbooks

Intermediate · 4-8 hours

Mastering Cursor IDE — Agent Mode, Rules, MCPs & Workflows

Master Cursor IDE's agent mode, custom rules, MCP integrations, and advanced workflows.

Last reviewed Feb 27, 2026

The complete guide to Cursor's agentic coding capabilities — from Agent Mode and custom rules to MCP integrations, Background Agents, and the workflows top developers use to ship faster. Built for the Authority AI Tools community.

Cursor is the AI-first code editor built as a VS Code fork by Anysphere. Unlike bolt-on AI extensions, Cursor was architected so AI is the primary interface — with full-repo RAG indexing, native agent loops, MCP support, and Background Agents that code autonomously in the cloud.


What is Cursor

Cursor is a VS Code fork redesigned from the ground up for AI-native development. It uses RAG (Retrieval-Augmented Generation) and vector embeddings to index your entire repository, enabling semantic search across all files — not just what's currently open. Cursor vs. VS Code

Feature VS Code Cursor
AI Integration Extension-based (Copilot) Native, first-class
Codebase Context Open files only Whole-repo RAG indexing (272k tokens)
Agent Autonomy No native agent Full agentic loop with terminal and file ops
Multi-file Editing Manual Composer/Agent mode natively
MCP Support Via extensions Native .cursor/mcp.json
Background Agents None Cloud-based autonomous agents
Pricing (2026)
Plan Price Key Limits
--- --- ---
Hobby (Free) $0 2-week Pro trial, 50 slow premium requests
Pro $20/month 500 fast premium requests, Background Agents
Business $40/user/month SSO, admin dashboard, centralized billing

Core Capabilities

Agent Mode (Cmd+I / Ctrl+I)

The flagship feature — a fully autonomous coding loop that can navigate your entire codebase, read/create/modify files, execute terminal commands, and iterate until goals are met.

  • Cmd+I opens the agent panel
  • Cmd+Shift+I opens full-screen Composer for large refactors
  • Plan Mode (Shift+Tab): Agent researches, asks questions, generates a plan, then waits for approval before coding

Tab Completion

Multi-line, semantically aware completions using your full codebase index. Accept with Tab, word-by-word with Cmd+→.

Cmd+K — Inline Editing

Select code → Cmd+K → type instruction → AI generates a diff in-place. Also works in the terminal for generating shell commands from natural language.

Chat Panel (Cmd+L)

Conversational interface for exploring code without modifying it — ask architectural questions, explore tradeoffs, summarize modules.

Multi-File Composer

Orchestrate changes across your entire codebase in a single operation. Run up to 8 parallel agents in isolated git worktrees.

@-Mention System

Mention What It Does
@codebase Search the full indexed repository
@file Include a specific file in context
@folder Include all files in a folder
@web Live web search
@docs Reference indexed documentation
@Past Chats Reference a previous conversation
@Branch Include git branch context
@image Reference an image file

Background Agents

Cloud-based autonomous agents that clone your repo, complete tasks, and create pull requests — all while you keep working locally. Setup: Enable in Settings → Beta → Background Agents. Requires GitHub connection and usage-based pricing enabled. Best for: Bug fixes, test generation, documentation, library migrations, tech debt. Limitation: GitHub repos only. Cannot run with Privacy Mode enabled.


Rules and Custom Instructions

Cursor uses a three-tier rules system for persistent AI instructions.

Tier 1: Global Rules

Location: Settings → Cursor Settings → Rules for AI Universal preferences that apply to every project.

- Write comments in English only
- Prefer functional programming; avoid classes
- Use strict typing everywhere
- Suggest only minimal changes related to the current task

Tier 2: Project Rules

Location: .cursor/index.mdc (recommended) or .cursorrules (legacy) Committed to git and shared with your team.

# Project: My SaaS App

## Stack
Next.js 15, TypeScript, Tailwind, Supabase, Postgres

## Directory Structure
- src/components/ — Reusable UI components (PascalCase)
- src/app/api/ — API route handlers
- src/lib/ — Shared utilities

## Patterns
- React Hook Form + Zod for forms
- Zustand for state (not Redux)
- Named exports for all components

## Commands
- npm run dev — Start dev server
- npm run build — Production build
- npm run test — Run unit tests

Tier 3: Context-Aware Dynamic Rules

Location: .cursor/rules/*.mdc Individual rule files that activate based on file patterns or task type.

.cursor/rules/
  react-components.mdc     # Auto for .tsx files
  api-standards.mdc        # Auto for app/api/**
  test-guidelines.mdc      # Auto for *.test.*
  database-patterns.mdc    # Agent-requested

Writing Effective Rules:

  1. Write what TO do, not what NOT to do
  2. Be concrete — "Keep functions under 30 lines" not "write clean code"
  3. Include rationale for each pattern
  4. Reference canonical example files
  5. Keep files under ~100 lines
  6. Update rules when the AI repeats mistakes Community Resources: cursor.directory for curated rule examples by framework.

Popular MCP Integrations

Configuration

Project-level: .cursor/mcp.json Global: ~/.cursor/mcp.json

{
  "mcpServers": {
    "server-name": {
      "command": "npx",
      "args": ["@package/mcp-server"],
      "env": { "API_KEY": "your-key" }
    }
  }
}

Essential MCP Servers for Cursor

GitHub MCP Manage repos, PRs, issues, and code search from within Cursor.

{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": { "Authorization": "Bearer YOUR_GITHUB_PAT" }
    }
  }
}

Supabase MCP Direct database access — schema, queries, migrations, edge functions.

{
  "mcpServers": {
    "supabase": {
      "command": "npx",
      "args": ["-y", "@supabase/mcp-server-supabase", "--read-only", "--project-ref=<ref>"],
      "env": { "SUPABASE_ACCESS_TOKEN": "<token>" }
    }
  }
}

Playwright MCP Browser automation — navigate, interact, screenshot, test.

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    }
  }
}

Figma MCP Pull design specs and component structures directly into Cursor.

{
  "mcpServers": {
    "figmaRemoteMcp": {
      "url": "https://mcp.figma.com/mcp"
    }
  }
}

Other Popular MCPs:

MCP Server Use Case
Context7 Real-time library documentation
PostgreSQL Database schema and queries
Firecrawl Web research and extraction
Notion Read/write project specs
Slack Team context and discussions
Memory Persistent context across sessions
Security Best Practices:
  • Keep approval prompts enabled for MCP tool calls
  • Use read-only modes for database connections
  • Scope MCP servers to specific projects, not globally
  • Never connect database MCPs to production data

Agentic Workflows

Workflow 1: Plan-First Approach

1. Shift+TabPlan Mode
2. Describe the feature with full context
3. Review the generated Markdown plan
4. Edit the plan to adjust steps
5. Save plan to .cursor/plans/
6. Switch to execution mode

Workflow 2: Test-Driven Development

1. Write failing tests specifying exact inputs/outputs
2. Commit: git add -A && git commit -m "tests: add failing tests"
3. Tell agent: "Implement feature to pass these tests"
4. Agent iterates until all tests pass
5. Review and commit implementation

Workflow 3: PRD → Implementation

1. Create PLAN.md or PRD.md in project root
2. Tell agent: "@PLAN.md implement this feature"
3. Agent implements based on spec
4. Update docs: "@README.md reflect current state"

Workflow 4: Parallel Agent Competition

Open multiple agent windows, give each the same prompt on different models (Claude + GPT), compare outputs using Judge's Recommendation.

Workflow 5: Background Agent Delegation

Assign bug fixes and tech debt to Background Agents while working on features locally. Review the PR when notified.

Prompt Engineering Formula

[CONTEXT] What files/components are involved?
[TASK] What exactly needs to happen?
[CONSTRAINTS] What patterns to follow, what NOT to change?
[SUCCESS CRITERIA] How do we know it's done?

Good prompt: "Using the existing usePagination hook and following the pattern in @components/UserList.tsx, add pagination to OrderList. Use our Button component. Don't change loading state logic. Add tests." Bad prompt: "Add pagination to the orders page"


Debugging Workflows

Debug Mode (Cursor 2.2+)

Agent generates hypotheses → adds logging → you reproduce → agent analyzes logs → makes targeted fixes → verifies → removes instrumentation.

Terminal Error → Agent Fix

When terminal commands fail, click "Debug with AI" — agent reads full error context and suggests a fix.

Strategic Logging

"Add console.log to trace data flow through processOrder(). 
Log input, each transformation step, and final output."

Multi-File Bug Tracing

"This error is in payment.service.ts:156 but the root cause is earlier. 
Trace data flow from checkout.component.ts to the error."

Limitations and Workarounds

Limitation Workaround
Context window limits at scale Explicitly @mention key files; break into subtasks
Context drift in long conversations Start new chat per task; commit frequently
Windows terminal issues Enable "Use Preview Box" or use WSL
AI hallucinations / invented APIs Use Context7 MCP; add library docs via @docs
Background Agents: GitHub only Mirror repos to GitHub for BGA use
Privacy Mode blocks Background Agents Evaluate data sensitivity per repo

Keyboard Shortcuts

Action Mac Windows
Inline AI edit Cmd+K Ctrl+K
Open Chat Cmd+L Ctrl+L
Open Agent Cmd+I Ctrl+I
Full-screen Composer Cmd+Shift+I Ctrl+Shift+I
New chat Cmd+Shift+L Ctrl+Shift+L
Plan Mode Shift+Tab Shift+Tab
Accept suggestion Tab Tab
Terminal AI Cmd+K (in terminal) Ctrl+K

Power User Tips

  1. Commit before every agent sessiongit add -A && git commit -m "checkpoint" is your safety net
  2. **Keep a **HISTORY.md — Tell agent to maintain a change log each session
  3. Use agent for git commits — "Generate conventional commit message for git diff HEAD"
  4. One task = one session — Context from previous tasks bleeds into new ones
  5. Don't start greenfield from scratch — Use a well-structured template repo with existing rules
  6. Generate rules from mistakes — "Generate a cursor rule to prevent this from happening"
  7. Select models by task — Haiku for boilerplate, Sonnet for edits, Opus for architecture

Last updated: February 27, 2026 Built for authorityaitools.com — AI Coding Tools Directory