Skip to main content

Adaptive modes

The preset AI MCP server intelligently adapts its behavior based on your design system's maturity level. This page covers the architecture, detection logic, and how to control it.

The problem

Different teams have different needs:

Team stageNeedAI role
Early / startupBuilding a design system from scratchCo-creator, advisor
GrowingExpanding patterns, some standardsSuggester, validator
EnterpriseEstablished standards, compliance criticalGuardian, enforcer

A one-size-fits-all approach does not work. An AI that blocks a startup from experimenting is frustrating. An AI that lets an enterprise team drift from standards is dangerous.

Three modes

The MCP automatically detects your design system's maturity and adjusts its behavior. The maturity score ranges 0–100 and maps to three modes.

Generative mode (score 0–30)

For: Early-stage teams building their design system.

Behavior:

  • generate_component proposes new presets when none match
  • Validation warns but does not block
  • Drift detection notes but allows
  • Can create new patterns without approval

Example:

User: "I need a delete button"
MCP:  "No preset matches. I'll propose one:
       - name: delete-action
       - component: Button
       - props: { variant: 'destructive' }
       Want me to create this?"

Hybrid mode (score 30–70)

For: Growing teams with some established patterns.

Behavior:

  • generate_component uses existing presets, suggests alternatives
  • Validation warns on violations, allows proceed
  • Drift detection warns, recommends fixes
  • Can propose new patterns with review

Example:

User: "I need a delete button"
MCP:  "No exact match. Similar presets exist:
       - destructive-action (confidence: 72%)
       - danger-outline (confidence: 58%)
       Use one of these, or request a new pattern from the design team."

Enforcement mode (score 70–100)

For: Enterprise teams with established standards.

Behavior:

  • generate_component requires an existing preset, blocks if none found
  • Validation blocks on violations
  • Drift detection alerts, can block
  • New patterns require formal approval

Example:

User: "I need a delete button"
MCP:  "ERROR: No approved preset matches 'delete button'.
       Cannot generate without an existing preset.
       Contact the design system team or use list_available_presets."

Detection signals

The maturity score is calculated from six weighted signals:

SignalWeightThresholdDescription
Presets25%30+Number of defined presets
Patterns20%10+Number of pattern definitions
Token coverage20%6 categoriesColor, spacing, typography, shadow, border, radius
Violation rules15%20+Number of violation patterns
Figma sync10%ConnectedWhether Figma is connected
Usage history10%1000+ callsMCP API usage count

Example calculation:

Presets:  18/30   = 60% × 25% = 15 points
Patterns: 5/10    = 50% × 20% = 10 points
Tokens:   3/6     = 50% × 20% = 10 points
Rules:    8/20    = 40% × 15% =  6 points
Figma:    0       × 10%       =  0 points
Usage:    250/1000 = 25% × 10% = 2.5 points

Total: 43.5 → HYBRID MODE

Mode tools

get_system_mode

Returns the current mode with full assessment.

// Request
{ refresh: false }

// Response
{
  mode: "hybrid",
  score: 47,
  confidence: "medium",
  signals: [...],
  behavior: {
    generation: { noMatchAction: "suggest", canCreateNew: true },
    validation: { onViolation: "warn", strictness: "moderate" },
    drift: { onDrift: "warn", blockOnDrift: false }
  },
  recommendations: [...]
}

set_system_mode

Override automatic detection.

// Request
{
  mode: "enforcement",  // or "generative", "hybrid", "auto"
  reason: "We have established patterns in Storybook",
  persist: true        // Save to database
}

// Response
{
  success: true,
  previousMode: "hybrid",
  newMode: "enforcement",
  persisted: true,
  behavior: {...}
}

Use mode: "auto" to clear the override and restore automatic detection.

explain_mode_decision

Get detailed reasoning for the current mode.

// Response
{
  currentMode: "hybrid",
  score: 47,
  reasoning: [
    "Score 47 is between thresholds (30-70)",
    "This indicates a growing design system",
    "presets: 18 presets defined (contributes ~15 points)",
    "patterns: 5 patterns defined (contributes ~10 points)"
  ],
  modeChanges: {
    toEnforcement: ["Need ~23 more points to reach threshold"],
    toGenerative: ["Use set_system_mode('generative') to override"]
  }
}

Override flow

When detection is wrong:

  1. User notices unexpected behavior — "Why is it blocking me? We're still building!"
  2. Call get_system_mode — returns "enforcement" with detected signals
  3. User investigates the signals — "Those are test presets, not real ones"
  4. Call set_system_mode("hybrid", { reason: "Presets are experimental", persist: true })
  5. MCP now uses hybrid behavior, and the override persists across sessions

Configuration

Via environment / config

const server = createServer({
  mode: 'hybrid',           // Override detection
  modeReason: 'Testing',    // Audit trail
});

Via database

Overrides are stored in the mode_overrides table, scoped per design system. Set expires_at for temporary overrides.

Behavioral matrix

ToolGenerativeHybridEnforcement
generate_component (no match)Propose newSuggest similarBlock
validate_generated_codeWarnWarnBlock
check_driftNoteWarnAlert / Block
get_forbidden_primitivesMinimalModerateStrict

FAQ

What if detection is consistently wrong? Use set_system_mode with persist: true to save the override. It persists across sessions.

Can different design systems have different modes? Yes. Overrides are scoped by design_system_id. Global overrides use null.

How do I see why a mode was chosen? Call explain_mode_decision for detailed reasoning and signal breakdown.

Can overrides expire? Yes. Set expires_at when creating the override. Useful for temporary mode switches.

How often is detection refreshed? On first tool call per session, then cached. Call get_system_mode({ refresh: true }) to force a refresh.

Was this page helpful?

Last reviewed by @jschuyler