FM

freema/mcp-design-system-extractor

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

73 stars 14 forks 质量 85 趋势 14MIT

freema/mcp-design-system-extractor 是从 https://github.com/freema/mcp-design-system-extractor. 导入的 MCP 服务器候选对象。

概览

freema/mcp-design-system-extractor 是从 https://github.com/freema/mcp-design-system-extractor. 导入的 MCP 服务器候选对象。

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,可从Storybook设计系统中提取组件信息。连接Storybook实例并提取HTML、样式和组件元数据。

安装

使用 Claude CLI(推荐)

使用自签名证书:

使用 NPM

然后在你的MCP客户端中配置(见环境变量)。

来自源头

关键依赖关系

  • Puppeteer:使用无头Chrome进行动态JavaScript组件渲染
  • Chrome/Chromium:Puppeteer 必备(在 Docker 中自动处理)
  • 与构建的Storybook发行版合作

特色

  • 列表组件:使用紧凑模式从故事书中获取所有可用组件
  • 提取HTML:获取任意组件的渲染HTML(异步或同步模式)
  • 搜索组件:按名称、标题、类别或目的查找组件
  • 组件依赖:分析哪些组件被用于其他组件
  • 主题信息:提取设计系统主题(颜色、间距、排版)
  • 外部CSS分析:获取并分析CSS文件以提取设计令牌

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Design System Extractor

A Model Context Protocol (MCP) server that extracts component information from Storybook design systems. Connects to Storybook instances and extracts HTML, styles, and component metadata.

Installation

claude mcp add design-system npx mcp-design-system-extractor@latest \
  --env STORYBOOK_URL=http://localhost:6006

With self-signed certificate:

claude mcp add design-system npx mcp-design-system-extractor@latest \
  --env STORYBOOK_URL=https://my-storybook.example.com \
  --env NODE_TLS_REJECT_UNAUTHORIZED=0

Using npm

npm install -g mcp-design-system-extractor

Then configure in your MCP client (see Environment Variables).

From Source

git clone https://github.com/freema/mcp-design-system-extractor.git
cd mcp-design-system-extractor
npm install && npm run build
npm run setup  # Interactive setup for Claude Desktop

Key Dependencies

  • Puppeteer: Uses headless Chrome for dynamic JavaScript component rendering
  • Chrome/Chromium: Required for Puppeteer (automatically handled in Docker)
  • Works with built Storybook distributions

Features

  • List Components: Get all available components from your Storybook with compact mode
  • Extract HTML: Get the rendered HTML of any component (async or sync mode)
  • Search Components: Find components by name, title, category, or purpose
  • Component Dependencies: Analyze which components are used within other components
  • Theme Information: Extract design system theme (colors, spacing, typography)
  • External CSS Analysis: Fetch and analyze CSS files to extract design tokens
  • Async Job Queue: Long-running operations run in background with job tracking

Environment Variables

Variable Description Default
STORYBOOK_URL URL of your Storybook instance http://localhost:6006
NODE_TLS_REJECT_UNAUTHORIZED Set to 0 to skip SSL certificate verification (for self-signed certs) 1

Example with self-signed certificate:

{
  "mcpServers": {
    "design-system": {
      "command": "node",
      "args": ["/path/to/dist/index.js"],
      "env": {
        "STORYBOOK_URL": "https://my-storybook.example.com",
        "NODE_TLS_REJECT_UNAUTHORIZED": "0"
      }
    }
  }
}

Usage

See DEVELOPMENT.md for detailed setup instructions.

Available Tools (9 total)

Core Tools

  1. list_components
    • Lists all available components from the Storybook instance
    • Use compact: true for minimal output (reduces response size)
    • Filter by category parameter
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "design-system": { "command": "node", "args": ["/path/to/dist/index.js"], "env": { "STORYBOOK_URL": "https://my-storybook.example.com", "NODE_TLS_REJECT_UNAUTHORIZED": "0" } } } }