Tutorial

MCP Design System Integration: Use Claude and Cursor with Real Tokens

Step-by-step guide to connecting your design system to Claude and Cursor using MCP so AI generates consistent, token-aligned UI code.

FramingUI Team5 min read

Why MCP Changes AI UI Workflows

Most teams using AI for frontend work hit the same ceiling: generated code is fast but inconsistent. You spend the saved time fixing design details manually.

Model Context Protocol (MCP) solves this by letting AI tools retrieve structured context from external systems, including your design system.

Instead of telling Claude or Cursor your token rules repeatedly, you expose them once through MCP and make them available during generation.

What MCP Integration Gives You

With MCP design system integration, your AI workflow shifts from "prompt-only" to "context-aware":

  • AI can query current design tokens directly
  • Generated code references approved semantic values
  • Component variants align with system contracts more often
  • Drift from stale copied guidelines drops significantly

This is especially important for teams that generate UI code daily.

Architecture Overview

At a high level:

  1. Your design system stores token data in machine-readable format
  2. An MCP server exposes token and component metadata
  3. AI clients (Claude, Cursor) call the MCP server during tasks
  4. Generated code uses retrieved design system context

This keeps your prompts smaller and your outputs more consistent.

Prerequisites

Before setup, make sure you have:

  • A repository with an existing design system or token files
  • Node.js runtime available for MCP server execution
  • Claude Code, Cursor, or another MCP-compatible client
  • Clear semantic token naming in your design system

If token naming is unclear, clean that first. MCP does not fix weak semantics.

Step 1: Prepare Token Sources

Ensure token data is available in structured files such as:

  • tokens.json
  • tokens.css
  • theme.ts exports

Recommended minimum fields:

  • Color semantics
  • Spacing scale
  • Typography scale
  • Radius and elevation
  • Component-level semantic aliases where relevant

Avoid exposing only raw palette values. Semantic mapping is where consistency comes from.

Step 2: Configure MCP for Claude

Create an MCP configuration for Claude that registers your design system server.

Example shape:

{
  "servers": {
    "design-system": {
      "command": "npx",
      "args": ["@framingui/mcp-server"],
      "env": {
        "PROJECT_PATH": ".",
        "TOKEN_PATH": "./tokens.json"
      }
    }
  }
}

After saving configuration, restart Claude client to load server definitions.

Step 3: Configure MCP for Cursor

Cursor uses a similar registration pattern.

Example shape:

{
  "mcpServers": {
    "design-system": {
      "command": "npx",
      "args": ["@framingui/mcp-server"],
      "env": {
        "PROJECT_PATH": ".",
        "TOKEN_PATH": "./tokens.json"
      }
    }
  }
}

Restart Cursor after updating config so the MCP server is discovered.

Step 4: Verify Connection and Capabilities

Run a simple capability check in each client.

Suggested prompts:

  • "List available design system tokens"
  • "Show button semantic tokens"
  • "Generate a settings form using existing tokens and component variants"

If AI cannot list tokens, check:

  • Server command path
  • Environment variable paths
  • Token file existence and JSON validity

Step 5: Use Prompt Patterns That Leverage MCP

MCP works best when prompts request constraints explicitly.

Good prompt template:

  • Build [component]
  • Use existing primitives only
  • Use semantic tokens only
  • Do not invent new variants
  • Include loading, empty, and error states

This combines retrieval with clear behavioral constraints.

Integration Pattern for Teams

For consistent team results, standardize workflow.

Pattern A: Shared Prompt Templates

Store reusable prompt templates in repo docs so everyone asks AI in the same constrained format.

Pattern B: CI/Lint Enforcement

Add checks for:

  • Hardcoded colors
  • Non-token spacing values
  • Unsupported variant names

This catches misses from both humans and AI.

Pattern C: Review Checklist

In PR review, verify:

  • Token usage is semantic
  • Existing primitives are used
  • Accessibility states remain intact

MCP improves generation quality, but review still matters.

Where FramingUI Helps in MCP Integration

FramingUI provides practical leverage in this setup by combining:

  • Token-first design system modeling
  • Reusable component structures
  • MCP-ready workflow support for AI clients

That combination reduces the gap between design system intent and generated implementation.

For teams that use Claude or Cursor heavily, this saves substantial cleanup time.

Common Integration Pitfalls

Pitfall 1: Exposing Raw Values Without Semantics

If token context is only blue-500, AI still has to guess intent.

Pitfall 2: No Component Contracts

Even with token data, AI may invent unsupported component props if primitive contracts are vague.

Pitfall 3: Stale Token Sources

If MCP reads outdated files, outputs become inconsistent with live UI.

Pitfall 4: Overlong Prompts Repeating What MCP Already Provides

Do not waste prompt space on data that MCP can fetch directly.

Security and Operational Notes

Treat MCP servers as part of developer infrastructure.

  • Limit scope of exposed files
  • Avoid leaking unrelated secrets through broad server access
  • Version token changes and document breaking naming updates
  • Keep development and production context boundaries clear

Operational discipline keeps integration reliable.

A 30-Minute Rollout Plan

If you want fast adoption:

  1. Validate token schema quality
  2. Register MCP server in Claude and Cursor
  3. Run three representative component generation tests
  4. Add lint rule for raw visual values
  5. Publish one team prompt template

This gives immediate quality gains without major process change.

Final Takeaway

MCP design system integration is not a "nice-to-have" for AI-heavy frontend teams. It is the difference between fast but noisy code generation and fast, reliable system-aligned output.

When Claude and Cursor can retrieve your real token context, they stop guessing and start composing inside your design system constraints.

That is how AI acceleration becomes production-ready instead of cleanup-heavy.

Ready to build with FramingUI?

Join the beta and get early access to agentic design systems that adapt to your needs.

Join Beta
Share

Related Posts