optics-mcp

v0.2.6
io.github.RoleModel/optics-mcp Checked 3 days ago Published 12 months ago

MCP Server for Optics Design System documentation and token usage.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_token

Get detailed information about a specific design token by name

ParameterTypeDescription
tokenName *stringThe name of the design token (e.g., "color-primary", "spacing-md")

search_tokens

Search for design tokens by category or name pattern

ParameterTypeDescription
categorystringFilter by category (color, spacing, typography, border, shadow)
namePatternstringSearch pattern for token names (case-insensitive)

get_token_usage_stats

Get statistics about design token usage across the system

get_component_info

Get detailed information about a component including its design token dependencies

ParameterTypeDescription
componentName *stringThe name of the component (e.g., "Button", "Card", "Input")

list_components

List all available components in the design system

get_component_tokens

Get all design tokens used by a specific component

ParameterTypeDescription
componentName *stringThe name of the component

search_documentation

Search through Optics documentation

ParameterTypeDescription
query *stringSearch query for documentation content

generate_theme

Generate a custom Optics theme with CSS variable overrides. Includes installation instructions for @rolemodel/optics via npm or CDN (jsDelivr/unpkg). Output includes complete setup guide with actual Optics token names.

ParameterTypeDescription
brandName *stringName of the brand/theme (e.g., "Acme Corp")
primary *stringPrimary brand color (hex, e.g., "#0066CC")
secondarystringSecondary color (hex, optional)

validate_token_usage

Validate code for hard-coded values that should use design tokens

ParameterTypeDescription
code *stringCSS or component code to validate

replace_hard_coded_values

Replace hard-coded values with design tokens

ParameterTypeDescription
code *stringCode containing hard-coded values
autofixbooleanWhether to automatically fix the code (default: false)

check_contrast

Check WCAG contrast ratio between two color tokens

ParameterTypeDescription
backgroundToken *stringBackground color token name
foregroundToken *stringForeground color token name

suggest_token_migration

Suggest design tokens for a hard-coded value

ParameterTypeDescription
value *stringHard-coded value to find tokens for (e.g., "#0066CC", "16px")
categorystringOptional category filter (color, spacing, typography)

generate_component_scaffold

Generate a React component scaffold with proper token usage

ParameterTypeDescription
componentName *stringName of the component (e.g., "Alert", "Card")
description *stringBrief description of the component
tokens *arrayList of token names the component should use

generate_sticker_sheet

Generate a visual style guide with color swatches and component examples

ParameterTypeDescription
frameworkstringTarget framework: react, vue, svelte, or html (default: react)
includeColorsbooleanInclude color swatches (default: true)
includeComponentsbooleanInclude component examples (default: true)
includeTypographybooleanInclude typography specimens (default: true)