
Optics Mcp
io.github.RoleModelPublished by GitHub account RoleModelv0.2.6Updated Oct 24, 2026
MCP Server for Optics Design System documentation and token usage.
Overview
Local MCP server exposing the Optics design system's tokens, components and docs so an assistant can look up, validate and generate token-based UI code.
- What you can do
- Look up and search design tokens, with usage statistics and category resources
- Inspect components, list them and see which tokens each depends on
- Search the Optics documentation and read bundled guides on color, spacing, typography and accessibility
- Generate branded themes as CSS variables and Figma Variables JSON
- Validate token usage, find hard-coded values, suggest token migrations and check WCAG contrast
- Scaffold components for React, Vue, Svelte or HTML and produce visual style-guide sticker sheets
- When to use it
- Useful when building or maintaining a UI that follows the Optics design system and you want the assistant to pick correct tokens, catch hard-coded values, check contrast or scaffold components instead of guessing token names.
- Requirements
- Runs as a local stdio process, typically launched with npx from the npm package optics-mcp; Node.js and network access for the package download are needed. No accounts, API keys or environment variables are declared.
Installation
In SourceWeft
- Open Optics Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Optics MCP Server
A Model Context Protocol (MCP) server for the Optics Design System, enabling LLMs to understand and work with design tokens, components, and documentation from https://docs.optics.rolemodel.design.
⚠️ IMPORTANT: Understanding Optics
If you're an AI agent, read SYSTEM_OVERVIEW.md FIRST!
Optics uses a sophisticated HSL-based color system that's different from typical design systems. The system overview explains:
- Why there's no
--color-primarytoken (use--op-color-primary-baseinstead) - The three-layer token architecture (HSL base → Scale → On tokens)
- How to find and use the correct tokens
- Common mistakes and how to avoid them
Key insight: Optics has 500+ color tokens organized as a predictable scale system, not simple name-value pairs.
Overview
This MCP server provides 14 tools and resources for working with the Optics design system:
- 83 Design Tokens: Real HSL-based colors, calc-based spacing, typography, borders, and shadows
- 24 Components: All Optics components with accurate token dependencies extracted from SCSS
- 7 Core Tools: Query tokens, components, and documentation
- 7 Advanced Tools: Theme generation, validation, accessibility checking, code scaffolding, and style guide generation
- 5 MCP Prompts: Pre-configured workflows for common design system tasks
- Documentation: Design system guidelines and best practices
Architecture
Installation
VS Code 🎨
Quick Setup:
- Command Palette → MCP: Open User Configuration
- Add this configuration:
- Open GitHub Copilot in Agent Mode
- Click the tools icon to see Optics tools available
Or create .vscode/mcp.json in your workspace with the same config.
Official MCP Registry: Listed at registry.modelcontextprotocol.io ✅
Cursor 🎯
One-Click Install (click to open Cursor):
Or Manual Setup:
- Open Cursor Settings → MCP
- Add this configuration:
- Chat with Cursor AI to access Optics tools
Quick Start (Zero-Install) ⚡
The easiest way to use Optics MCP - no installation required!
Claude Desktop
Add to your MCP configuration:
Claude Code CLI
Add with a single command:
Other useful commands:
That's it! The server runs automatically whenever your MCP client needs it.
Local Installation (For Development)
If you want to modify the server or contribute:
Then configure with the local path:
Usage
Running Directly
Available Tools (14 Total)
For detailed documentation of all tools, see TOOLS.md.
Core Tools
get_token
Get detailed information about a specific design token.
search_tokens
Search for design tokens by category or name pattern.
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.
list_components
List all available components in the design system.
get_component_tokens
Get all design tokens used by a specific component.
search_documentation
Search through Optics documentation.
Advanced Tools
generate_theme
Create a custom branded theme with CSS variables and Figma Variables JSON.
- Outputs HSL-based theme overrides
- Generates Figma Variables format
- Creates theme preview
validate_token_usage
Find hard-coded values in code that should use design tokens.
- Detects colors, spacing, fonts, borders, shadows
- Suggests token replacements
- Validates token usage
replace_hard_coded_values
Automatically replace hard-coded values with design tokens.
- Manual mode: suggestions only
- Autofix mode: applies replacements
- Preserves code structure
check_contrast
Check WCAG color contrast ratios between tokens.
- Supports AA and AAA levels
- Works with token names or hex colors
- Provides accessibility recommendations
suggest_token_migration
Suggest tokens for legacy code migration.
- Maps old values to new tokens
- Prioritizes semantic tokens
- Provides rationale
generate_component_scaffold
Generate component code with Optics tokens.
- React, Vue, Svelte, HTML support
- Pre-configured with design tokens
- TypeScript types included
generate_sticker_sheet
Generate a visual style guide showing all design tokens and components.
- Complete color palettes with swatches
- Typography scale examples
- Spacing visualizations
- Component examples
- Multi-framework support (React, Vue, Svelte, HTML)
- Production-ready code output
Available Resources
The server exposes the following resources via the optics:// URI scheme:
Documentation
optics://documentation/introduction- Overview of Opticsoptics://documentation/getting-started- Getting started guideoptics://documentation/design-tokens- Design token documentationoptics://documentation/color-system- Color system guideoptics://documentation/spacing- Spacing system guideoptics://documentation/typography- Typography guideoptics://documentation/components- Component library overviewoptics://documentation/accessibility- Accessibility guidelines
Tokens
optics://tokens/all- All design tokensoptics://tokens/color- Color tokens onlyoptics://tokens/spacing- Spacing tokens onlyoptics://tokens/typography- Typography tokens only
Components
optics://components/all- All components
Design System Overview
Design Token Categories
- Colors (25 tokens): HSL-based color system with primary, neutral, and alert colors
- Spacing (11 tokens): calc-based rem units with base-10 scale (2px to 80px)
- Typography (32 tokens): Noto Sans/Serif fonts with sizes, weights, and line heights
- Borders (10 tokens): Border radius (small to pill) and widths
- Shadows (5 tokens): Elevation system (x-small to x-large)
Components (24 Total)
All components extracted from real Optics SCSS with accurate token dependencies:
- Accordion: Collapsible content panel
- Alert: Notification messages (warning, danger, info, notice)
- Avatar: User profile pictures
- Badge: Status indicators and labels
- Breadcrumbs: Navigation hierarchy
- Button: Interactive buttons with variants
- ButtonGroup: Grouped button container
- Card: Content containers with elevation
- ConfirmDialog: Action confirmation modals
- Divider: Content separators
- Form: Input fields, textareas, selects
- Icon: Material Symbols icons
- Modal: Overlay dialogs
- Navbar: Top navigation
- Pagination: Page navigation
- SidePanel: Sliding side panels
- Sidebar: Side navigation
- Spinner: Loading indicators
- Switch: Toggle switches
- Tab: Tabbed interfaces
- Table: Data tables
- Tag: Categorization labels
- TextPair: Label-value pairs
- Tooltip: Contextual information
Each component specifies which Optics design tokens it uses, making it easy to understand dependencies and maintain consistency.
Development
Build
Watch Mode
Project Structure
Token Usage Tracking
The server tracks which design tokens are used by each component, enabling:
- Dependency Analysis: Understand which tokens a component relies on
- Impact Analysis: See which components are affected by token changes
- Usage Statistics: Get insights into token usage patterns
Contributing
To add new design tokens or components:
- Edit
src/optics-data.ts - Add tokens to the
designTokensarray - Add components to the
componentsarray, specifying their token dependencies - Rebuild the project:
npm run build
License
MIT
Links
Source: README.md at commit 3687719
Tools
0Version history
1- v0.2.6LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts