A production-ready Model Context Protocol (MCP) server for managing CSS Custom Properties (design tokens). This server enables AI assistants and other MCP clients to read, query, search, and update design tokens from CSS/SCSS files.
- 📖 Multi-file Support - Reads tokens from multiple CSS and SCSS files
- 🔍 Advanced Querying - Filter by file, category, prefix, or semantic type
- 📊 Statistics - Get token counts and distribution across files
- 🎨 Color Palette Tools - Dedicated tools for color tokens with scale support
- ✏️ Typography Tools - Query font families, weights, sizes, and line heights
- 📐 Spacing Tools - Get spacing tokens by size or type
- 🔄 Update Tokens - Modify token values and persist changes
- 🖼️ Theme from Image - Generate a branding theme from a website screenshot or design image using LLM vision
- 🌐 Theme from CSS - Extract a branding theme by fetching and analyzing a website's CSS
- ⚡ Pagination - Handle large token sets efficiently
| File | Description | Category |
|---|---|---|
branding-token.css |
Core brand tokens (colors, fonts, spacing base) | branding |
color-token.scss |
Derived color tokens with scales and mixing | color |
background-color-token.scss |
Background colors for UI states | background-color |
text-color-token.scss |
Text/foreground colors | text-color |
border-color-token.scss |
Border colors for UI states | border-color |
border-token.scss |
Border width and radius | border |
font-token.scss |
Font families, weights, line heights | font |
font-size-token.scss |
Font size scales with responsive calculations | font-size |
spacing-token.scss |
Spacing scales for margins/padding | spacing |
box-shadow-token.scss |
Box shadow tokens for elevation | box-shadow |
transition-token.scss |
Animation timing and duration | transition |
scaling-token.scss |
Scaling factors for responsive design | scaling |
npm installnpm startThis uses stdio transport, suitable for local MCP clients like Claude Desktop.
npm run start:httpOr directly:
MCP_TRANSPORT=http PORT=3000 node index.jsThis starts an HTTP server with the MCP Streamable HTTP transport, suitable for cloud deployments behind a reverse proxy.
| Endpoint | Description |
|---|---|
/mcp |
MCP Streamable HTTP endpoint |
/health |
Health check (JSON) |
For local use (stdio):
{
"mcpServers": {
"design-tokens": {
"command": "node",
"args": ["/path/to/design-tokens-mcp/index.js"]
}
}
}For remote use (Streamable HTTP):
{
"mcpServers": {
"design-tokens": {
"type": "streamable-http",
"url": "https://tokens.yourdomain.com/mcp"
}
}
}Retrieve a specific token by name with its source file and category.
{ "name": "ks-brand-color-primary" }List tokens with filtering and pagination.
{
"file": "branding",
"category": "color",
"prefix": "ks-brand",
"limit": 50,
"offset": 0
}List all token files with descriptions and token counts.
Get statistics: total tokens, counts by file, category, and prefix.
Search tokens by pattern in names or values.
{
"pattern": "primary",
"searchIn": "name",
"file": "color",
"limit": 50
}Get tokens by semantic type:
interactive- hover, active, selected, disabled statesinverted- dark mode variantsscale- alpha/mixing scale variantsbase- base tokensresponsive- breakpoint-specific tokenssizing- size scale tokens (xxs-xxl)
{ "type": "interactive", "file": "background-color" }Get color tokens organized by type.
{
"colorType": "primary",
"includeScales": true
}Color types: primary, positive, negative, informative, notice, fg, bg, link
Get typography tokens filtered by font type or property.
{
"fontType": "display",
"property": "size"
}Font types: display, copy, interface, mono
Properties: family, weight, size, line-height
Get spacing tokens by size or type.
{
"size": "m",
"type": "stack"
}Sizes: xxs, xs, s, m, l, xl, xxl
Types: stack, inline, inset, base
Get core branding tokens (the primary tokens to modify for theming).
{ "type": "colors" }Types: colors, fonts, spacing, borders, shadows, all
Update a token value in its source file.
{
"name": "ks-brand-color-primary",
"value": "#4075d0"
}Analyze a website screenshot or design image to generate a branding theme. Accepts a base64-encoded image or an image URL. Returns the image for LLM vision analysis alongside the current theme schema with field descriptions and tips.
{ "imageUrl": "https://example.com/screenshot.png" }Or with base64:
{ "imageBase64": "iVBORw0KGgo...", "mimeType": "image/png" }Supported formats: image/png, image/jpeg, image/webp
Fetch all CSS from a website (inline <style> blocks and linked <link rel="stylesheet"> stylesheets) and return it for analysis. Extracts exact color values, font families, font sizes, CSS custom properties, and more.
{ "url": "https://example.com" }With full raw CSS included:
{
"url": "https://example.com",
"includeRawCSS": true,
"maxStylesheets": 10
}Returns:
- Pre-parsed summary (unique hex/RGB/HSL colors, font families, custom property count)
:root/htmlCSS custom properties (most valuable for theming)- All CSS custom properties found (up to 200)
- Current theme schema with field descriptions
- Optionally, the full raw CSS text
The design token system follows a layered architecture:
-
Branding Tokens (
branding-token.css)- Core values: primary colors, font families, base sizes
- These are the tokens to modify for theming
-
Derived Tokens (SCSS files)
- Computed from branding tokens using
var()references - Include scales, states, and responsive variants
- Computed from branding tokens using
-
Semantic Tokens
- Purpose-specific tokens (background, text, border colors)
- Interactive states (hover, active, selected, disabled)
- Inverted variants for dark mode
1. list_files → See all token files with counts
2. get_token_stats → See distribution by category
1. get_branding_tokens { type: "colors" } → See editable colors
2. update_token { name: "ks-brand-color-primary", value: "#new-color" }
1. get_color_palette { colorType: "primary" } → See primary colors
2. get_color_palette { colorType: "primary", includeScales: true } → With alpha scales
1. get_tokens_by_type { type: "interactive", file: "background-color" }
1. generate_theme_from_image { imageUrl: "https://example.com/screenshot.png" }
→ LLM analyzes the image using vision
2. update_theme_config { path: "color.primary", value: "#extracted-color" }
→ Apply each extracted value
1. extract_theme_from_css { url: "https://example.com" }
→ Returns parsed CSS with colors, fonts, custom properties
2. update_theme_config { path: "color.primary", value: "#exact-color-from-css" }
→ Apply each extracted value
1. extract_theme_from_css { url: "https://example.com" }
→ Get exact values (colors, font families, sizes)
2. generate_theme_from_image { imageUrl: "https://screenshot-url.png" }
→ Get visual cues (spacing density, personality, layout rhythm)
3. update_theme_config for each value
All errors return consistent JSON:
{
"error": "Error message",
"tool": "tool_name",
"timestamp": "2026-01-22T12:00:00.000Z"
}- Node.js 16+ (ES modules support)
- @modelcontextprotocol/sdk ^1.25.3
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT |
Transport mode: stdio or http |
stdio |
PORT |
HTTP server port (when http mode) |
3000 |
NODE_ENV |
Environment mode | production |
ISC