ds-mcp

ds-mcp

A read-only MCP server that provides AI coding agents with a queryable contract for design system tokens, components, patterns, and anti-patterns.

Category
访问服务器

README

ds-mcp

Stop asking AI agents to guess your design system. Give them a contract they can query.


The problem

AI coding agents generate UI by guessing: they invent component names, fabricate props, hardcode color values, and ignore the patterns your team has documented. Every generated file needs manual correction to match your design system.

The solution

ds-mcp is a read-only MCP server that loads a dspack file — a portable JSON description of your design system — and exposes its contents as tools that agents can query before generating code. The agent asks questions; ds-mcp answers with your team's actual tokens, components, props, patterns, and anti-patterns.

What this is

  • A read-only MCP server. It retrieves design system information. It does not generate code, write files, or make network calls.
  • The reference implementation of the dspack specification (supports v0.1 and v0.2).

What this is not

  • A code generator. Code generation is the agent's job.
  • A Figma sync tool. dspack files are authored and versioned by your team.
  • A runtime dependency. ds-mcp runs alongside your MCP client during development, not in production.

How it works

  1. Create a dspack file describing your design system's tokens, components, patterns, and anti-patterns. (Use the included shadcn/ui v0.2 example to try it now, or the v0.1 example for the minimal format.)
  2. Start ds-mcp with the dspack file. It loads the file once and holds it in memory.
  3. Connect your MCP client (Claude Desktop, Claude Code, Cursor, GitHub Copilot). The agent can now query your design system at coding time.

Quick start

# 1. Install
npm install -g @aestheticfunction/ds-mcp

# 2. Download the shadcn/ui v0.2 example dspack
curl -L https://raw.githubusercontent.com/aestheticfunction/ds-mcp/main/examples/shadcn-ui-v02.dspack.json \
  -o shadcn-ui.dspack.json

# 3. Run with the downloaded file
ds-mcp --dspack ./shadcn-ui.dspack.json

Configure your MCP client to connect to ds-mcp. See docs/README.md for client-specific configuration examples.

What agents can ask

Agent question Tool call Returns
What components are available? list-components Components with names, descriptions, deprecation and lifecycle status
Which components are stable? list-components { status: "stable" } Only components with stable lifecycle status
How do I use the Button component? get-component { id: "button" } Props, usage guidance, tokens, accessibility, composition, constraints
What's the right layout for a settings form? get-pattern { id: "settings-form" } Components to use, guidance on control selection and layout
What color token should I use for text? get-token { category: "color", name: "foreground" } Token value, description, type, tier, status, aliasOf
Which tokens relate to spacing? search-tokens { query: "spacing" } All tokens matching "spacing" across names, categories, descriptions, tier
What should I avoid doing? list-antipatterns Anti-patterns with reasoning, severity, and preferred alternatives
What are the must-not rules? list-antipatterns { severity: "must-not" } Only anti-patterns with must-not severity
How do I import Button in React? get-framework-mapping { framework: "react", componentId: "button" } Import path, install command, sub-component exports, guidance
What overrides does the dark theme apply? get-theme { id: "dark" } Theme description and token override map
What breakpoints should I use? get-layout Breakpoints, grid config, container sizes, spacing scale

Tools

ds-mcp exposes nine read-only tools:

Tool Input Description
get-token { category, name } Retrieve a single design token by category and name
search-tokens { query } Search tokens by name, category, description, type, tier, status, or aliasOf
get-component { id } Retrieve a full component definition including accessibility, composition, and constraints
list-components { status? } List all components; optionally filter by lifecycle status
get-pattern { id } Retrieve a documented usage pattern by ID
list-antipatterns { severity? } List all anti-patterns; optionally filter by severity
get-framework-mapping { framework, componentId? } Retrieve framework-specific information including sub-component export mappings
get-theme { id } Retrieve a theme definition with token overrides
get-layout none Retrieve layout primitives: breakpoints, grid, containers, spacing scale

Requirements

  • Node.js 20.0.0 or later
  • A dspack v0.1 or v0.2 file (see the dspack spec)

Configuration

ds-mcp accepts the dspack file path via:

  1. --dspack <path> CLI flag (first priority)
  2. DSPACK_PATH environment variable (fallback)

Set DSMCP_DEBUG=true for verbose stderr logging.

Documentation

Development

npm install
npm run build
npm test
bash scripts/smoke.sh

Security

ds-mcp is architecturally read-only. It does not write files, execute commands, or make network calls. Any behavior that violates these constraints is a defect. See SECURITY.md for reporting instructions.

License

Copyright 2026 Aesthetic Function, LLC.

Licensed under the Apache License, Version 2.0. See LICENSE for the full text.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选