Skip to main content

Cursor integration

Cursor generates UI code. preset AI makes that code design-system-aware.

Cursor is an AI-first IDE whose agent writes code, refactors files, and answers questions about your repo. On its own, the agent has no vocabulary for your design system: it sees your repo's components but can invent off-token colors, off-grid spacing, or forbidden utilities without flagging them. Connect preset AI's MCP server and the same agent validates against your tokens before suggesting code, cites your rules by name when reviewing snippets, and proposes fixes from your canonical preset library.

This page is the setup config. For the operating workflow, prompting template, and team policy, see Cursor operating guide.

Cursor Rule setup

Cursor's agent does not automatically prefer MCP tools when your repo already has design-system documentation. To make sure the agent calls preset AI on UI work, drop a rule file at .cursor/rules/preset.mdc in your project:

---
description: Validate UI code against the preset AI design system
globs: ["**/*.tsx", "**/*.jsx", "**/*.ts", "**/*.css", "**/*.scss"]
alwaysApply: false
---

When working on UI components, Tailwind classes, CSS, or design tokens:

1. Before writing or suggesting UI code, call `validate_code` from the preset AI
   MCP server to check it against the active design system. Cite the returned
   `ruleId` and `fix` fields verbatim in your response.
2. When the user shares a hex color, px value, or arbitrary Tailwind value
   (e.g. `bg-[#0a0a0a]`, `p-[17px]`), call `resolve_value` to get the
   canonical token name or closest alternatives.
3. When generating new components or files, call
   `get_active_constraints(filePath)` first to learn path-scoped rules.
4. Before introducing a new utility or class, check `get_forbidden_primitives()`.

Always cite preset AI rule names (e.g. `no-uppercase`, `no-inline-hex-color`,
`ai-slop-arbitrary-spacing`) when explaining design system violations.

This is Cursor's equivalent of the per-server usage guidance other MCP clients support. The rule auto-attaches to UI files and tells the agent when preset AI is the right tool to reach for.

What this catches

Tested end-to-end. Sample violations and the agent's response when validate_code fires:

Violationpreset AI MCP returnsCursor agent renders
<div className="bg-[#0a0a0a]">no-inline-hex-color, severity: "warning", fix: "Use canonical token""Hit on #0a0a0a: use a CSS token variable" + diff
<span className="uppercase tracking-widest">BETA</span>no-uppercase, hits on uppercase and tracking-widest"Use hierarchy via size/weight (text-xs font-medium) instead of uppercase + tracking"
<div className="p-[17px] gap-[11px]">ai-slop-arbitrary-spacing, forbidden_primitive"Off-grid spacing: use p-2, p-4 from the Tailwind spacing scale"
style={{ backgroundColor: '#00aaff' }}no-inline-hex-color"Saturated cyan #00aaff is specifically out of system"

The agent renders the structured violations from preset AI (rule, found, fix, severity, line, ruleId) inline and typically follows up with a token-compliant rewrite.

How it works

OAuth vs API key

OAuth (recommended), Each Cursor user authenticates individually. No shared credentials, clean audit trail, tokens refresh automatically. Cursor implements OAuth metadata discovery, so the bare {"url": "..."} config is enough, no client registration step required. Best for individuals and teams.

API key: Generate a pk_live_* key at presetai.dev/api and pass it as a Bearer header. Best for shared-account or scripted setups. Replace your mcpServers.preset block with the auth form documented at cursor.com/docs/mcp.

Tool scoping

Cursor's agent has access to all of preset AI's MCP tools by default and chooses which to call based on the task. Unlike review-only MCP clients (e.g. CodeRabbit), Cursor benefits from the full tool surface: generation tools (generate_code, suggest_preset), validation tools (validate_code, quick_check_violations), and lookup tools (resolve_value, get_active_constraints) all matter inside an IDE.

If you want a narrower surface, expand the chevron next to the tool count in Settings → Tools & MCPs → preset and toggle individual tools off.

Data flow

When Cursor's agent calls a preset AI tool, it sends the file path, code snippet, and any inferred intent. preset AI resolves the active design system's rules: forbidden primitives, context rules, tokens, presets, scoped by layer if configured, and returns structured results. Cursor renders these inline in the agent panel and applies suggested fixes if you accept them.

No code is stored on preset AI's side. Queries are processed in real time and logged to the design system's audit trail, not Cursor's.

FAQ

Which Cursor plan do I need?

Any plan, including Free. Cursor does not gate MCP server installation by plan tier.

Do I need to install Cursor's CLI / cursor command for this to work?

No. The MCP integration runs inside the Cursor desktop app. The cursor CLI is for launching the editor from the terminal and is independent of MCP.

How do I revoke Cursor's access?

Two paths. From Cursor: Settings → Tools & MCPs → preset → Logout. From preset AI: Connect → Active integrations, find the Cursor MCP Client entry, revoke. Either revokes the refresh token on preset AI's side immediately.

Does this work in Cursor's terminal product or on cursor.com (Web)?

The integration is validated for Cursor Desktop. Cursor's terminal agent and Web product surface MCP differently and are not yet covered. File a request if you need either.

Why does the agent sometimes ignore preset AI and read local docs instead?

Cursor's agent picks the cheapest path to an answer. If your repo already has CLAUDE.md, AGENTS.md, or design-system docs that cover the same ground, it may read those instead of calling preset AI. The recommended Cursor Rule above (.cursor/rules/preset.mdc) tells the agent when preset AI is the authoritative source.

What gets logged?

Every MCP call from Cursor is logged to preset AI's audit trail with client ID, tool name, and timestamp. OAuth events (token issuance, refresh, revocation) are captured in the oauth_events telemetry table with structured reason codes.

Was this page helpful?

Last reviewed by @jschuyler
All systems operationalDocsDevelopersPlatformPricing
PrivacyTerms© 2026 fndd, LLC