Skip to content
NLEN
← Apps overview

Cursor: technical tutorial

By Ivo Donker · — created with AI assistance (writer: DeepSeek V4.1 Flash; critic: Gemini 3.8 Flash)

Cursor: ReviewInstall & set upNewsTechnical tutorial

As of September 2026, compiled from our own notes and news archive; text machine-generated and editorially checked. Check versions and commands in the official documentation.

This tutorial is for developers who want to get more out of Cursor than the chat: rules with glob scoping, MCP servers with variables and OAuth, the command-line agent in scripts and CI, and control over costs and privacy. All file names and keys have been checked against the official documentation (as of September 2026).

Rules: four types

Cursor recognises four types of instructions:

If you want Claude Code, Codex and Cursor to follow the same instructions, put the shared rules in AGENTS.md and keep the Cursor-specific refinement in .cursor/rules/.

The .mdc format

A project rule is markdown with frontmatter. Ordinary .md files in .cursor/rules/ are ignored.

---
description: "API-handlers: validatie en foutafhandeling"
globs: src/api/**/*.ts
alwaysApply: false
---
- Valideer elke request-body met zod voordat je hem gebruikt.
- Geef fouten terug in het formaat `{ error: { code, message } }`.
- Log nooit volledige request-bodies; ze kunnen persoonsgegevens bevatten.

The three fields together determine when a rule is included:

A practical pattern: one short rule with alwaysApply: true for the basics (stack, test and build commands), and otherwise rules with globs for each part of the codebase.

MCP servers

You configure MCP servers in JSON: per project in .cursor/mcp.json, or globally in ~/.cursor/mcp.json.

A local server (stdio):

{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mijn-db-mcp"],
      "env": { "DATABASE_URL": "${env:DATABASE_URL}" }
    }
  }
}

A remote server (Streamable HTTP or SSE):

{
  "mcpServers": {
    "docs": {
      "url": "https://docs.example.com/mcp",
      "headers": { "Authorization": "Bearer ${env:DOCS_TOKEN}" }
    }
  }
}

You can use variables in values, so that no key ends up in your repository:

For servers with fixed OAuth credentials, you add an auth object:

{
  "mcpServers": {
    "crm": {
      "url": "https://api.example.com/mcp",
      "auth": {
        "CLIENT_ID": "${env:MCP_CLIENT_ID}",
        "CLIENT_SECRET": "${env:MCP_CLIENT_SECRET}",
        "scopes": ["read"]
      }
    }
  }
}

Register http://localhost:8787/callback with the provider as a redirect URL for the desktop app, and https://www.cursor.com/agents/mcp/oauth/callback for the web version and cloud agents.

The command-line agent in scripts and CI

Install with curl https://cursor.com/install -fsS | bash; the program is called agent. With -p (or --print) it runs without interaction.

export CURSOR_API_KEY="..."   # uit je Cursor-dashboard, als secret in CI

# alleen analyseren
agent -p "Wat doet deze codebase?"

# wijzigingen doorvoeren zonder bevestiging
agent -p --force "Zet deze module om naar moderne ES-syntax"

# gestructureerde uitvoer voor verdere verwerking
agent -p --output-format json "Geef een lijst van ongebruikte exports"

A simple CI step that stores a review as an artefact:

agent -p --output-format json \
  "Beoordeel de wijzigingen ten opzichte van main op bugs en beveiligingsrisico's" \
  > review.json

Managing costs

As of September 2026, Cursor uses two monthly allowances:

What helps:

Privacy and teams

Troubleshooting

Documentation: cursor.com/docs.