io.github.kenneives/design-token-bridge-mcp

内容与创意

by kenneives

在 Tailwind、Figma、CSS、Material 3 与 SwiftUI 之间转换 design tokens,便于统一设计系统。

什么是 io.github.kenneives/design-token-bridge-mcp

在 Tailwind、Figma、CSS、Material 3 与 SwiftUI 之间转换 design tokens,便于统一设计系统。

README

design-token-bridge-mcp

<a href="https://glama.ai/mcp/servers/kenneives/design-token-bridge-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/kenneives/design-token-bridge-mcp/badge" /> </a> <br> <a href="https://agentgraph.co/profile/1e7b584d-2621-47a8-a314-20b9a908353a"> <img src="https://agentgraph.co/api/v1/badges/trust/1e7b584d-2621-47a8-a314-20b9a908353a.svg?style=detailed&theme=dark" alt="AgentGraph Trust Score" height="30" /> </a>

<sub>Verified on <a href="https://agentgraph.co">AgentGraph</a> — trust infrastructure for AI agents. <a href="https://agentgraph.co/profile/1e7b584d-2621-47a8-a314-20b9a908353a">View profile</a></sub>

An MCP server that translates design tokens between platforms. Extract tokens from Tailwind, CSS, Figma, or W3C DTCG format — then generate native themes for Material 3 (Kotlin), SwiftUI (with Liquid Glass), Tailwind, and CSS Variables.

Built for the v0 → Figma → Claude Code design pipeline.

code
┌──────────────┐     ┌──────────────┐     ┌────────────────────────┐
│  Tailwind     │     │              │     │  Material 3 (Kotlin)   │
│  CSS Vars     │────▶│  Universal   │────▶│  SwiftUI (Swift)       │
│  Figma Vars   │     │  Token       │     │  Tailwind Config       │
│  W3C DTCG     │     │  Schema      │     │  CSS Variables         │
└──────────────┘     └──────────────┘     └────────────────────────┘
    Extractors           Bridge              Generators

Install

From npm

bash
npm install -g design-token-bridge-mcp

From source

bash
git clone https://github.com/kenneives/design-token-bridge-mcp.git
cd design-token-bridge-mcp
npm install && npm run build

Configure with Claude Code

Add to your Claude Code MCP settings (~/.claude/settings.json or project .mcp.json):

json
{
  "mcpServers": {
    "design-token-bridge": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "design-token-bridge-mcp"]
    }
  }
}

Or if installed from source:

json
{
  "mcpServers": {
    "design-token-bridge": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/design-token-bridge-mcp/build/index.js"]
    }
  }
}

Tools (9 total)

Extractors — Input → Universal Tokens

ToolInputDescription
extract_tokens_from_tailwindtailwind.config.js contentParses colors, fontSize, spacing, borderRadius, boxShadow
extract_tokens_from_cssCSS file contentExtracts --color-*, --space-*, --radius-*, --shadow-* custom properties
extract_tokens_from_figma_variablesFigma Variables API JSONParses COLOR, FLOAT types, resolves aliases, handles multi-mode
extract_tokens_from_jsonW3C DTCG format JSONParses $value/$type/$description, resolves {aliases}, handles groups

Generators — Universal Tokens → Output

ToolOutputDescription
generate_material3_themeKotlin (Jetpack Compose)lightColorScheme(), Typography, Shapes with M3 naming
generate_swiftui_themeSwift (SwiftUI)Color extensions, Font structs, optional Liquid Glass (iOS 26+)
generate_tailwind_configtailwind.config.jsTheme extend block with rem units, ESM or CJS
generate_css_variablesCSS custom properties:root block with light/dark mode via prefers-color-scheme

Validation

ToolDescription
validate_contrastWCAG AA/AAA contrast checking for color pairs with pass/fail + ratios

Universal Token Schema

All tools speak this common format:

json
{
  "colors": {
    "primary": { "value": "#6750A4", "description": "Brand primary", "category": "primary" }
  },
  "typography": {
    "display-large": { "fontSize": 57, "lineHeight": 64, "fontWeight": 400, "fontFamily": "Inter" }
  },
  "spacing": { "xs": 4, "sm": 8, "md": 16 },
  "radii": { "sm": 8, "md": 12, "lg": 16 },
  "elevation": {
    "low": {
      "shadowColor": "#000000",
      "shadowOffset": { "x": 0, "y": 2 },
      "shadowRadius": 4,
      "shadowOpacity": 0.1
    }
  },
  "motion": {
    "fast": { "duration": 150, "easing": "ease-out" }
  }
}

Example: Full Pipeline

1. Extract tokens from a Tailwind config

code
Use extract_tokens_from_tailwind with the contents of my tailwind.config.js

2. Generate native themes from the extracted tokens

code
Take those tokens and run them through:
- generate_tailwind_config (for the web app)
- generate_material3_theme (for Android)
- generate_swiftui_theme with liquidGlass=true (for iOS)
- generate_css_variables (for a vanilla CSS fallback)

3. Validate accessibility

code
Run validate_contrast on those tokens at AAA level

Example Output

See the examples/qt-games/ directory for a complete responsive landing page built entirely from MCP-generated tokens, including:

  • qt-games-tokens.json — extracted universal tokens
  • tailwind.config.js — generated Tailwind config
  • variables.css — generated CSS custom properties
  • contrast-report.json — WCAG validation (AAA pass)
  • index.html + styles.css — responsive landing page using the generated tokens

v0 + Figma Free Tier Setup

This MCP works with free tiers of both v0 and Figma. See the setup guides:

Tech Stack

  • TypeScript + Node.js
  • @modelcontextprotocol/sdk v1.x (stdio transport)
  • Zod for schema validation
  • Zero heavyweight dependencies — no Babel, no PostCSS, no Style Dictionary

Tests

bash
# 91 unit tests
npm test

# 31 Playwright visual/responsive tests
npm run test:e2e

Contributing

See CONTRIBUTING.md for development setup, project structure, and PR guidelines.

License

MIT — see LICENSE.

常见问题

io.github.kenneives/design-token-bridge-mcp 是什么?

在 Tailwind、Figma、CSS、Material 3 与 SwiftUI 之间转换 design tokens,便于统一设计系统。

相关 Skills

文档共著

by anthropics

Universal
热门

围绕文档、提案、技术规格、决策记录等写作任务,按上下文收集、结构迭代、读者测试三步协作共创,减少信息遗漏,写出更清晰、经得起他人阅读的内容。

写文档、方案或技术规格时容易思路散、信息漏,它用结构化共著流程帮你高效传递上下文、反复打磨内容,还能从读者视角做验证。

内容与创意
未扫描151.3k

内部沟通

by anthropics

Universal
热门

按公司常用模板和语气快速起草内部沟通内容,覆盖 3P 更新、状态报告、领导汇报、项目进展、事故复盘、FAQ 与 newsletter,适合需要统一格式的团队沟通场景。

按公司偏好的模板快速产出状态汇报、领导更新和 FAQ,既省去反复改稿,也让内部沟通更统一、更专业。

内容与创意
未扫描151.3k

平面设计

by anthropics

Universal
热门

先生成视觉哲学,再落地成原创海报、艺术画面或其他静态设计,输出 .png/.pdf,强调构图、色彩与空间表达,适合需要高完成度视觉成品的场景。

做海报、插画或静态视觉稿时,用它能快速产出兼顾美感与版式的PNG/PDF成品,原创设计更省心,也更适合规避版权风险。

内容与创意
未扫描151.3k

相关 MCP Server

免费的加密新闻聚合 MCP,汇集 Bitcoin、Ethereum、DeFi、Solana 与 altcoins 资讯源。

内容与创意
237

用于Adobe Photoshop自动化的MCP server,让AI assistants直接控制Photoshop。

内容与创意
105

by ProfessionalWiki

让 Large Language Model 客户端无缝连接任意 MediaWiki 站点,可创建、更新、搜索页面,并通过 OAuth 2.0 安全管理内容。

内容与创意16 个工具
96

评论