Skip to main content
Glama
tabaldi98

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesID do componente (ex: "button", "list")

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must disclose behavior. It only states what is returned, but does not mention potential errors, authentication, rate limits, or side effects. For a read operation, basic behavioral transparency is missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently conveys the tool's purpose and return value. It is front-loaded with the key action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately lists the types of details returned (inputs, outputs, usage examples, import). Missing error handling or scope details, but sufficient for a simple fetch tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for the single parameter 'id'. The description does not add meaning beyond the schema example. Baseline 3 is appropriate as schema covers the parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'retorna' and the resource 'detalhes completos de um componente', specifying the content: inputs, outputs, usage examples, and import. It distinguishes from sibling tools like list-components and search-components.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for fetching full details of a specific component, but lacks explicit guidance on when to use versus alternatives or when not to use. No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-component-usageB

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

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesID do componente (ex: "button", "list")

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided. The description only states what it returns, but does not disclose any behavioral traits such as whether it is safe, requires authentication, or has side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, concise sentence that efficiently communicates the tool's purpose with no extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is adequate for a simple tool with one parameter, but lacks details about the return format or structure of the usage examples and import instructions. Could be more complete given there is no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the 'id' parameter has a clear description in the schema). The tool description adds no additional meaning beyond the schema, earning the baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns usage examples and import instructions for a component (specific verb and resource). It distinguishes from siblings like 'get-component' (which likely returns component details), 'list-components', and 'search-components'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. It does not provide any context about prerequisites, scenarios, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list-componentsA

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

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNoFiltrar componentes por categoria

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses basic behavior (list components, filter) but does not mention return format, pagination, or potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that front-loads the purpose and includes the optional filter, with no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with one optional parameter and no output schema, the description is minimally adequate but does not describe return value structure or other contextual details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description restates the category filter already documented in the schema, adding no extra meaning beyond what the schema provides. Schema coverage is 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all available components in the Design System with an optional category filter, distinguishing it from sibling tools like get-component (single component) and search-components (search).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for listing with optional filtering but does not explicitly contrast with siblings or provide when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search-componentsA

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

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesTermo de busca para encontrar componentes

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only states the search fields (name, description, tags) but omits details like case sensitivity, partial matching, pagination, or read-only nature. This is insufficient for a search tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that conveys the core purpose. It is appropriately sized for a simple tool with one parameter, though it could include brief behavioral notes.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and simple parameters, the description is minimally adequate but lacks details on return format, pagination, or matching behavior. It covers the essential 'what' but not the 'how' of results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers the single parameter with a description ('search term'), and the description adds value by specifying the fields searched (name, description, tags). This extra context helps the agent understand what the query matches against.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (search) and the resource (components) with the scope (by name, description, or tags). It distinguishes from sibling tools like list-components (which lists all) and get-component (single component retrieval).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context: use this tool when searching components by specific terms. While it does not explicitly mention alternatives, the sibling tool names (list-components, get-component) naturally differentiate the use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 4 tool updatesv1.0.2
    • First observedget-component
    • First observedget-component-usage
    • First observedlist-components
    • First observedsearch-components

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