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 stage | Need | AI role |
|---|---|---|
| Early / startup | Building a design system from scratch | Co-creator, advisor |
| Growing | Expanding patterns, some standards | Suggester, validator |
| Enterprise | Established standards, compliance critical | Guardian, 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_componentproposes 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_componentuses 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_componentrequires 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:
| Signal | Weight | Threshold | Description |
|---|---|---|---|
| Presets | 25% | 30+ | Number of defined presets |
| Patterns | 20% | 10+ | Number of pattern definitions |
| Token coverage | 20% | 6 categories | Color, spacing, typography, shadow, border, radius |
| Violation rules | 15% | 20+ | Number of violation patterns |
| Figma sync | 10% | Connected | Whether Figma is connected |
| Usage history | 10% | 1000+ calls | MCP 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:
- User notices unexpected behavior — "Why is it blocking me? We're still building!"
- Call
get_system_mode— returns "enforcement" with detected signals - User investigates the signals — "Those are test presets, not real ones"
- Call
set_system_mode("hybrid", { reason: "Presets are experimental", persist: true }) - 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
| Tool | Generative | Hybrid | Enforcement |
|---|---|---|---|
generate_component (no match) | Propose new | Suggest similar | Block |
validate_generated_code | Warn | Warn | Block |
check_drift | Note | Warn | Alert / Block |
get_forbidden_primitives | Minimal | Moderate | Strict |
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.