AI Coding Harnesses & IDE Setup · 8 min read

Cursor Rules (.mdc) vs. Skills vs. MCP Memory: Complete Architecture Guide

Understand the differences between Cursor .mdc rules, procedural agent skills, and dynamic MCP persistent memory. Learn when to use each for optimal IDE workflows.

Direct Answer (TL;DR) Self-Contained GEO Passage

In Cursor IDE, developers often confuse three complementary context layers: Cursor Rules (.mdc), Agent Skills, and Model Context Protocol (MCP) Memory. Rules provide static, glob-matched prompt constraints; Skills define multi-step procedural playbooks triggered by user intent; and MCP Memory provides a dynamic, read-write persistent cognitive graph that preserves decisions across sessions. Combining all three creates an ultra-efficient, token-optimized coding environment.

.mdc Format
Modern frontmatter-based rule format replacing legacy .cursorrules
Cursor Official Documentation
3 Layers
Context architecture layers: Static Rules, Procedural Skills, Dynamic Memory
AI Context Engineering Architecture
65% Token Drop
Token savings achieved by offloading project state to MCP tools
Memoreal Benchmark Report
Table of Contents ↓

Cursor Architecture: Rules (.mdc) vs. Skills vs. MCP Persistent Memory

Cursor Architecture: Rules (.mdc) vs. Skills vs. MCP Persistent Memory
MechanismScope & TimingMutability & StateContext Window ImpactPrimary Role
Cursor Rules (.mdc)Applied on matching file globsStatic markdown with YAML frontmatterInjected into prompt system preambleCoding style, naming conventions, and file headers
Cursor Agent SkillsInvoked when intent matches triggerStatic markdown instructions with tool scriptsLoaded into conversation turn when triggeredStep-by-step procedural playbooks (e.g., deployments)
Memoreal MCP MemoryQueried dynamically on-demandDynamic read-write graph with belief revisionZero token tax until specific tools are invokedCross-session memory, architecture decisions, and bug history
Legacy .cursorrulesAlways loaded in global contextUnstructured flat text file (deprecated)Burns input tokens on every turnDeprecated legacy pattern replaced by .mdc and MCP

The Triad of Cursor Context: Rules, Skills, and Memory

Cursor has evolved from a simple code completion extension into a comprehensive autonomous agent environment. To steer Cursor Composer and Agent mode effectively, developers must distinguish between three distinct architectural abstractions: Rules, Skills, and Memory.

Rules specify static invariants like code styling, formatting standards, and required imports. Skills represent procedural workflows—such as executing a canary deployment or generating a PRD—that guide the agent through sequential steps. Finally, Memory provides stateful awareness, allowing Cursor to recall past bugs, architectural decisions, and teammate preferences across multiple chat threads.

  • Rules define the boundaries of acceptable code generation (what code must look like).
  • Skills define the execution recipe for complex operations (how multi-step tasks are performed).
  • Memory stores historical truth and learned project context (why decisions were made).

Migrating from Deprecated .cursorrules to Modern .mdc Files

In early versions of Cursor, developers dumped all project instructions into a single root .cursorrules file. As projects expanded, this monolithic file grew to thousands of tokens, consuming context window capacity on every single keystroke and confusing the agent with irrelevant instructions.

Cursor introduced .mdc files located inside .cursor/rules/ to solve this problem. Each .mdc file includes YAML frontmatter defining specific file globs and trigger conditions. For instance, React component rules only load when an engineer opens a .tsx file, saving thousands of tokens during backend Python development.

  • Monolithic .cursorrules files waste prompt tokens and degrade model attention on irrelevant tasks.
  • .mdc files enable fine-grained glob matching, loading context strictly when matching files are edited.
  • Frontmatter metadata allows teams to designate rules as always-on or conditionally activated.

Why Dynamic MCP Memory Completes the Context Puzzle

While .mdc rules and Skills manage static prompts and procedural playbooks, neither provides a writable runtime state. Once a Cursor chat session closes, any nuanced technical understanding the model uncovered about an elusive race condition or legacy API quirk is permanently lost.

By adding Memoreal MCP server to Cursor (~/.cursor/mcp.json), Cursor gains dynamic memory capabilities. The agent can invoke tools like encode_memory to save architectural decisions, recall_memories to pull historical context, and impact to analyze symbol blast radius—without polluting your static repository files.

  • Dynamic memory prevents repetitive debugging sessions when working on complex legacy systems.
  • Memoreal MCP enables Cursor to share knowledge seamlessly with Claude Code and Codex CLI.
  • Zero token tax is incurred until Cursor explicitly invokes a memory retrieval tool.

Configuring a Modern Cursor .mdc Rule Integrated with Memoreal MCP

markdown
---
description: Database architecture and migration guidelines
globs: ["src/models/**/*.ts", "migrations/**/*.sql"]
alwaysApply: false
---
# Database Architecture Rules
1. Before altering any existing schema, query Memoreal persistent memory:
   - Call `tools.memoreal.recall_memories({ query: "entity schema invariants" })`
2. Never execute raw destructive SQL migrations without dry-run validation.
3. Record all schema changes into Memoreal:
   - Call `tools.memoreal.encode_memory({ content: "Added user_tier column to users", type: "semantic" })`

Frequently Asked Questions

When should I create a Cursor Rule (.mdc) instead of an Agent Skill?

Use a Cursor Rule (.mdc) for static invariants like code style, naming conventions, and file structures. Use an Agent Skill when you need a procedural, step-by-step workflow with multiple tool actions or commands.

Can Cursor Agent Skills directly invoke Memoreal MCP memory tools?

Yes, Cursor Agent Skills can explicitly instruct the model to call Memoreal MCP tools like recall_memories or encode_memory at designated stages of a workflow.

Does using Memoreal MCP increase token costs in Cursor Composer?

No, Memoreal MCP does not inject unsolicited tokens into the prompt preamble. It exposes structured tools that Cursor calls on demand, saving up to 65% in token costs compared to large static prompt files.

60-Second Setup

Install Persistent Memory for Your Coding Agent

Sub-15ms deterministic recall, AST symbol navigation, and 70%+ token savings across Claude Code, Cursor, Codex CLI, and Windsurf.

npx -y @kolivri/memoreal-mcp setup
Start Free (1,000 Calls · $0 LLM Tax) Compare All Alternatives →