# @classic-homes/theme-mcp 中文文档

规范地址：https://npmcn.com/package/%40classic-homes/theme-mcp/

版本：0\.5\.8
npm 元数据更新时间：2026-11-06T18:00:21.898Z
中文译文更新时间：2026-11-09T23:52:54.939Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40classic-homes/theme-mcp
原文对照：https://npmcn.com/package/%40classic-homes/theme-mcp/?lang=original
项目主页：https://theme.classichomes.com/svelte/docs/getting-started/ai-integration
源码仓库：https://github.com/Classic-Homes/classic-theme

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：3.9 MB，10 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=18\.0\.0
- 运行依赖：2 个
- 首次发布：2026-01-14T23:23:26.799Z
- 最新版本发布：2026-11-06T18:00:21.436Z
- 近 30 天下载量：2523（2026-10-10 至 2026-11-08，npm 官方下载统计）
- 已发布版本数：63（近 12 个月 63 个）

## 中文简介

经典的 MCP 服务器 主题设计系统 - 使AI助手能够理解并正确使用组件,符号,和图案

## 安装

```sh
npm install @classic-homes/theme-mcp
```

也可以使用：`pnpm add @classic-homes/theme-mcp`、`yarn add @classic-homes/theme-mcp`、`bun add @classic-homes/theme-mcp`

## README

# @ classic-homes/ 主题- mcp

经典主题设计系统的MCP(模式上下文协议)服务器. 这个软件包使得克洛德等AI助手能够理解并正确使用经典主题组件,设计符号,布局模式,以及验证计划.

## 为什么用这个?

当AI助手可以访问MCP服务器时,他们可以:

-   **生成正确的组件代码** 带有适当的道具和变体
-   **遵循设计系统模式** 用于布局和表格
-   **使用正确的设计符号** 用于颜色、间距和打字
-   **验证用途** 以在运行时间前捕捉出错
-   **加快发展** 删除猜测

## 快速启动

### 有 npx( 无安装)

```bash
npx @classic-homes/theme-mcp
```

### 全球安装

```bash
npm install -g @classic-homes/theme-mcp
classic-theme-mcp
```

### 在工程中安装

```bash
npm install --save-dev @classic-homes/theme-mcp
```

## 配置 Claude 代码

添加到您的 `~/.claude/settings.json`数字 :

```json
{
  "mcpServers": {
    "classic-theme": {
      "command": "npx",
      "args": ["@classic-homes/theme-mcp"]
    }
  }
}
```

或为本地安装:

```json
{
  "mcpServers": {
    "classic-theme": {
      "command": "node",
      "args": ["./node_modules/@classic-homes/theme-mcp/dist/cli.js"]
    }
  }
}
```

更新配置后重新启动 Claude 代码 .

## 包含什么

### 资源(只读数据)

核心构成部分和设计系统资源:

-   `components://catalog`
-   `components://list`
-   `components://{name}`
-   `components://category/{category}`
-   `tokens://all`
-   `tokens://colors`
-   `tokens://spacing`
-   `tokens://typography`
-   `styles://all`
-   `styles://integration`
-   `styles://base`
-   `styles://accessibility`
-   `styles://utilities`
-   `patterns://all`
-   `patterns://layouts`
-   `patterns://forms`
-   `patterns://auth`
-   `patterns://notifications`
-   `patterns://{id}`
-   `schemas://all`
-   `schemas://auth`
-   `schemas://common`

特定软件包资源:

-   `auth://all`
-   `auth://core`
-   `auth://svelte`
-   `auth://testing`
-   `auth://types`
-   `auth://api`
-   `auth://core/{module}`
-   `auth://svelte/{module}`
-   `auth://quick-reference`
-   `notifications://all`
-   `notifications://core`
-   `notifications://svelte`
-   `notifications://types`
-   `notifications://api`
-   `notifications://utils`
-   `notifications://core/{module}`
-   `notifications://quick-reference`
-   `docs://all`
-   `docs://components`
-   `docs://utilities`
-   `docs://types`
-   `docs://extensions`
-   `docs://styles`
-   `docs://quick-reference`
-   `charts://all`
-   `charts://theme`
-   `charts://types`
-   `charts://utils`
-   `charts://quick-reference`
-   `charts://props`
-   `charts://data`
-   `charts://events`
-   `charts://reporting`
-   `gantt://all`
-   `gantt://types`
-   `gantt://scheduling`
-   `maps://all`
-   `maps://theme`
-   `maps://types`
-   `maps://utils`
-   `maps://route`
-   `maps://geocoding`
-   `maps://components`
-   `maps://quick-reference`
-   `maps://props`
-   `maps://data`
-   `maps://events`
-   `maps://hooks`
-   `maps://best-practices`
-   `maps://theme-types`
-   `maps://overlay-layers`
-   `maps://migration`
-   `maps://positioning`
-   `native://all`
-   `native://react`
-   `native://svelte`
-   `native://core`
-   `native://features`
-   `native://types`
-   `native://quick-reference`
-   `viewers://all`
-   `viewers://formats`
-   `viewers://setup`

### 工具( 可查询函数)

| 工具 | 说明 |
| --- | --- |
| `search_components` | 按名称/类别/功能查找组件 |
| `get_component_props` | 获取组件的详细道具 |
| `suggest_pattern` | 获取推荐的使用例模式 |
| `validate_component_usage` | 检查使用是否符合准则 |

### 提示( 模板)

| 提示 | 说明 |
| --- | --- |
| `build_form` | 用校验生成窗体 |
| `layout_page` | 生成页面布局 |
| `component_usage` | 生成组件使用示例 |

## 示例互动

### 叫克洛德创建一个仪表盘

```
"Create a dashboard page with sidebar navigation and a data table"
```

Claude会用MCP向上看 `DashboardLayout` 道具吗, `DataTable` 配置,并生成正确的类型脚本代码.

### 询问组件变体

```
"What variants does the Alert component have?"
```

克劳德查询 `get_component_props` 和返回:默认、破坏性、成功、警告、信息.

### 生成窗体

```
"Create a contact form with name, email, and message fields"
```

克劳德使用 `build_form` 生成窗体 `FormField` 组件、 Zod 验证和正确处理错误.

## 构成部分类别

-   **核心项目**:按钮,输入,卡片,徽章,标签等.
-   **表单**: 窗体字段、 选择、 复选框、 无线电组、 幻灯片等.
-   **版式**: DashboardLayout, PublicLayout, AuthLayout, 错误Layout, 动作标题、 工具栏、 分块控制、 视图切换
-   **反馈**: 土司、斯宾纳、斯凯通、警报
-   **数据**: 数据表,标签
-   **覆盖**: 对话框、 提醒对话框、 工具提示、 滴出菜单
-   **导航**: 侧边栏、页眉、页脚、快链接
-   **商标**: LogoMain, 装入Logo

## 对于软件包维护者

### 重新生成目录

当经典 更新主题组件:

```bash
npm run generate
npm run build
```

### 构建

```bash
npm run build      # Generate catalog + build
npm run build:fast # Build only (skip generation)
```

### 本地测试

```bash
# Run the server
npm run start

# Test with MCP Inspector
npx @modelcontextprotocol/inspector node dist/cli.js
```

## 所需资源

-   节点.js 18或以后
-   经典 在您的工程中安装的主题包( 用于全部功能)

## 相关软件包

-   `@classic-homes/theme-svelte` - Svelte 组件库
-   `@classic-homes/theme-react` - 反应组件库
-   `@classic-homes/theme-tokens` - 设计标志
-   `@classic-homes/theme-tailwind-preset` - 尾风配置

## 文档

-   [AI 融合指南](https://theme.classichomes.com/svelte/docs/getting-started/ai-integration)
-   [构成部分文件](https://theme.classichomes.com/svelte/docs/components/button)
-   [开始](https://theme.classichomes.com/svelte/docs/getting-started/installation)

## 许可证

麻省理工学院

## 常见问题

### @classic-homes/theme-mcp 是什么？

经典的 MCP 服务器 主题设计系统 - 使AI助手能够理解并正确使用组件,符号,和图案

### 如何安装 @classic-homes/theme-mcp？

在项目目录运行 npm install @classic-homes/theme-mcp，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 classic-theme-mcp，可以用 npx classic-theme-mcp 直接运行。

### @classic-homes/theme-mcp 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @classic-homes/theme-mcp 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @classic-homes/theme-mcp 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=18\.0\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @classic-homes/theme-mcp 可以商用吗？

@classic-homes/theme-mcp 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @classic-homes/theme-mcp 的下载量有多少？

根据 npm 官方下载统计，@classic-homes/theme-mcp 在 2026/10/10 – 2026/11/08 这 30 天内被下载 2,523 次，日均约 84 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @classic-homes/theme-mcp 还在维护吗？

最新版本 0\.5\.8 发布于 2026/11/07（3 天前）；至今共发布 63 个版本，其中过去 12 个月发布了 63 个；首次发布于 2026/01/15。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

