BrowserStack Design Stack MCP Server

BrowserStack Design Stack MCP Server

A standalone MCP server that provides AI assistants with comprehensive access to BrowserStack's design system components, enabling component search, detailed prop analysis, and usage examples from Storybook.

Category
访问服务器

README

BrowserStack Design Stack MCP Server

A standalone Model Context Protocol (MCP) server that provides AI assistants with comprehensive access to BrowserStack's design system components. This server extracts and serves structured metadata about React components from both source code (using react-docgen) and Storybook files.

Features

  • 🔍 Component Search: Search for components by name, functionality, or use case
  • 📖 Detailed Component Info: Get comprehensive prop information from both react-docgen and Storybook
  • 📋 Component Listing: Browse all available components in the design system
  • 🔍 Props Analysis: Compare prop information between different sources
  • 🎯 Real Usage Examples: Extract actual usage examples from Storybook stories
  • ⚙️ Configurable Paths: Use environment variables to point to any design system location

Installation

  1. Clone or copy this repository to your desired location (outside the frontend repo)
  2. Install dependencies:
npm install
  1. Configure the design system path:
cp .env.example .env
# Edit .env and set DESIGN_STACK_PATH to your design system location

Configuration

Set the following environment variables in your .env file:

# Required: Path to your design system package
DESIGN_STACK_PATH=/path/to/your/design-stack

# Optional: Enable debug logging
DEBUG=false

# Optional: Enable caching (future feature)
ENABLE_CACHE=false

Usage

As an MCP Server

Start the server for use with MCP-compatible tools:

npm start

Testing Locally

Run the test script to verify functionality:

npm test

Available MCP Tools

The server provides these tools to AI assistants:

1. search_components

Search for components by name or functionality.

Parameters:

  • query (string): Search term
  • limit (number, optional): Max results (default: 10)

2. get_component_info

Get detailed information about a specific component.

Parameters:

  • componentName (string): Name of the component (e.g., "Accordion", "Button")

3. list_all_components

Get a list of all available components in the design system.

Parameters: None

4. analyze_component_props

Compare prop information between react-docgen and Storybook sources.

Parameters:

  • componentName (string): Name of the component to analyze

Integration with AI Tools

Claude Desktop (MCP)

Add this configuration to your Claude Desktop MCP settings:

{
  "mcpServers": {
    "design-stack": {
      "command": "node",
      "args": ["/path/to/design-stack-mcp-server/src/index.js"],
      "env": {
        "DESIGN_STACK_PATH": "/path/to/your/design-stack"
      }
    }
  }
}

VS Code Extensions

The server can be integrated with VS Code extensions that support MCP protocol.

How It Works

Component Analysis

The server analyzes components from two sources:

  1. React-docgen: Extracts props from component source code, including:

    • Prop types and names
    • Required/optional status
    • Default values
    • JSDoc descriptions
  2. Storybook argTypes: Extracts props from Storybook configuration:

    • Rich descriptions
    • Control types
    • Default values
    • Type summaries

Example Extraction

The server extracts real usage examples from Storybook stories:

  • Template-based stories: Extracts simple props from .args configurations
  • Functional stories: Extracts component usage from exported functions
  • Complex examples: Handles nested JSX and complex prop values

Data Merging

Props from both sources are intelligently merged:

  • Storybook descriptions are preferred (usually more comprehensive)
  • Type information is combined from both sources
  • Source tracking shows where each piece of information originated

Example Output

# Accordion

**Description:** The Accordion component provides a way to toggle the visibility of content sections.

## Props:
  • **defaultOpen**: boolean [storybook]
    Determines whether the Accordion is to be open by default.
  • **children**: node (required) [react-docgen, storybook]
    The content to be rendered inside the Accordion.
  • **wrapperClassName**: string [storybook]
    A custom CSS class name to style the wrapper of the Accordion component.

## Examples from Storybook:
  **InteractiveAccordion**:
  ```jsx
  <Accordion defaultOpen={true} />

InteractiveAccordion example from Storybook

File Locations:

  • Component: /path/to/design-stack/modules/Accordion/index.jsx
  • Storybook: /path/to/design-stack/modules/Accordion/Accordion.stories.jsx

## Development

### Project Structure

design-stack-mcp-server/ ├── src/ │ ├── index.js # MCP server implementation │ └── component-analyzer.js # Component analysis logic ├── .env.example # Environment configuration template ├── .env # Local environment configuration ├── package.json # Dependencies and scripts └── README.md # This file


### Adding New Features

The server is designed to be extensible. You can add new tools by:

1. Adding new functions to `component-analyzer.js`
2. Registering new tools in `index.js` using `server.tool()`
3. Testing with the test script

### Debug Mode

Enable debug logging to troubleshoot issues:

```bash
echo "DEBUG=true" >> .env
npm start

Requirements

  • Node.js 18+
  • Design system with React components
  • Storybook files (optional but recommended for better descriptions)

License

MIT License - see package.json for details.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选