Design Token Bridge Mcp

io.github.kenneives由 GitHub 账号 kenneives 发布v1.0.2更新于 Oct 24, 2026

Translate design tokens between Tailwind, Figma, CSS, Material 3, and SwiftUI

已验证STDIO仅桌面开发者工具媒体与设计

概览

AI 生成的概览

本地 MCP 服务器,在 Tailwind、CSS、Figma 变量、W3C DTCG JSON、Material 3 与 SwiftUI 主题之间转换设计令牌。

可以做什么
  • 从 Tailwind 配置、CSS 自定义属性、Figma Variables JSON 和 W3C DTCG JSON 中提取令牌,统一为通用令牌结构
  • 生成 Material 3 Kotlin 主题、SwiftUI 主题(可选 Liquid Glass)、Tailwind 配置或带明暗模式的 CSS 变量
  • 对颜色组合做 WCAG AA/AAA 对比度检查,返回是否通过及对比度比值
  • 可串联各步骤,把同一份令牌输出到 Web、Android 和 iOS 目标
适用场景
适合需要把设计系统或品牌色板同步到 Web、Android 与 iOS 代码库的场景,也适合让助手基于已有的 Tailwind、CSS 或 Figma 令牌来源重新生成原生主题文件并检查对比度。
运行要求
以本地 stdio 进程在桌面端运行。可全局安装 npm 包或用 npx 运行,也可用 Node.js 从源码构建后运行构建产物。未声明账号、API 密钥或环境变量;令牌输入以文件内容形式传入。
安装前请注意
工具会读取你提供的令牌文件内容并返回生成的主题代码,提交到项目前应检查生成的配置与主题。未声明凭据或网络访问,但 README 链接的外部设置指南和第三方信任档案不属于服务器本身。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Design Token Bridge Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[AgentAvow Trust] — signed, offline-verifiable tool-safety grade

design-token-bridge-mcp

[图片]
[AgentGraph Trust Score]

Verified on AgentGraph — trust infrastructure for AI agents. View profile

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.

┌──────────────┐     ┌──────────────┐     ┌────────────────────────┐│  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.gitcd design-token-bridge-mcpnpm 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

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

2. Generate native themes from the extracted tokens

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

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 testsnpm test
# 31 Playwright visual/responsive testsnpm run test:e2e

Contributing

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

License

MIT — see LICENSE.

来源:README.md,提交 d13c8b3

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分