Skip to main content
Glama
bunge-ds-mcp

bunge-ds-mcp

by tabaldi98

bunge-ds-mcp

MCP (Model Context Protocol) 服务器,用于公开 @bunge/ds-components 设计系统的组件目录。它允许 AI 助手列出、搜索并获取组件的完整详情,包括输入、输出、使用示例和导入说明。

该服务器通过 stdio 进行通信(不公开 HTTP 端口)。通信通过进程本身进行,直接集成到 MCP 客户端(例如:VS Code Copilot)。

工具 (Tools)

工具

描述

list-components

列出所有可用组件,支持按类别筛选 (form, layout, navigation, feedback, data-display, overlay)

get-component

按 ID 返回组件的完整详情(输入、输出、用法、导入)

search-components

按名称、描述或标签搜索组件

get-component-usage

返回组件的使用示例和导入说明

如何开始

前置要求

  • Node.js 18+

  • npm 9+

安装与构建

npm install
npm run build

本地运行

npm start

服务器通过 stdio 启动 — 没有 HTTP 端口。它由直接连接到该进程的 MCP 客户端使用。

MCP 客户端配置(例如:VS Code)

{
  "mcpServers": {
    "bunge-ds-mcp": {
      "command": "npx",
      "args": ["bunge-ds-mcp"]
    }
  }
}

或者指向本地构建版本:

{
  "mcpServers": {
    "bunge-ds-mcp": {
      "command": "node",
      "args": ["dist/index.js"]
    }
  }
}

package.json 脚本

脚本

命令

描述

build

tsc

将 TypeScript 编译为 dist/ 文件夹中的 JavaScript

start

node dist/index.js

启动 MCP 服务器(需要先构建)

dev

tsc --watch

以监视模式编译 — 每次更改时自动重新编译

dev:inspect

tsc && npx @modelcontextprotocol/inspector node dist/index.js

编译并打开 MCP Inspector 以交互方式测试工具

test

vitest run

运行一次单元测试

test:watch

vitest

以监视模式运行测试

docker:infra:up

docker compose up -d --wait

在 4873 端口启动 Verdaccio(私有 npm 注册表)

docker:infra:down

docker compose down

停止并移除 Verdaccio 容器

registry:login:private

npm login --registry http://localhost:4873

登录到本地私有注册表 (Verdaccio)

release:private

npm version patch && npm publish --registry http://localhost:4873

增加版本号 (patch) 并发布到本地私有注册表

本地基础设施 (Docker)

docker-compose.yaml 会在 4873 端口 (http://localhost:4873) 启动一个 Verdaccio(私有 npm 注册表)。用于在不发送到公共 npm 的情况下模拟包发布。

npm run docker:infra:up    # sobe o Verdaccio
npm run registry:login:private  # autentica no registry local
npm run release:private    # publica o pacote localmente

项目结构

src/
├── index.ts              # Entrada: cria o McpServer e conecta ao transport
├── tools/                # Registro das tools (uma por arquivo)
│   ├── index.ts          # Barrel — registra todas as tools
│   ├── list-components.ts
│   ├── get-component.ts
│   ├── search-components.ts
│   └── get-component-usage.ts
├── data/
│   └── components.ts     # Catálogo de componentes do DS
├── models/
│   └── mcp-server.model.ts  # Interfaces e tipos
└── tests/
    ├── data.spec.ts
    └── tools.spec.ts

Available Tools

4 tools
get-componentA

Retorna detalhes completos de um componente: inputs, outputs, exemplos de uso e import.

Inputs: id (required).

get-component-usageB

Retorna exemplos de uso e instruções de import de um componente.

Inputs: id (required).

list-componentsA

Lista todos os componentes disponíveis no Design System, com filtro opcional por categoria.

Inputs: category.

search-componentsA

Busca componentes por nome, descrição ou tags.

Inputs: query (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation4/5

    The tools have distinct purposes, but get-component-usage is a subset of get-component, potentially causing minor confusion. Descriptions help differentiate, so overall good.

    Naming Consistency5/5

    All tools follow a consistent verb_noun snake_case pattern (get-, list-, search-), making them predictable and easy to understand.

    Tool Count5/5

    With 4 tools, the set is well-scoped for browsing a design system, covering listing, searching, and retrieving details without being excessive.

    Completeness5/5

    The tools provide full coverage for component browsing: list with filter, search, full details, and usage info. No obvious gaps in this domain.

    Related MCP Connectors