exploria-ui-mcp-server 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -34
- package/dist/index.js +2655 -2651
- package/package.json +4 -7
package/README.md
CHANGED
|
@@ -49,11 +49,11 @@ pnpm install
|
|
|
49
49
|
|
|
50
50
|
#### 具体 IDE 配置
|
|
51
51
|
|
|
52
|
-
| IDE
|
|
53
|
-
|
|
54
|
-
| Cursor
|
|
55
|
-
| Trae IDE
|
|
56
|
-
| 其他支持 MCP 的 IDE | 参考官方文档
|
|
52
|
+
| IDE | 配置文件位置 | 操作步骤 |
|
|
53
|
+
| ------------------- | ------------------------------------- | ------------------------------------------------------ |
|
|
54
|
+
| Cursor | `%APPDATA%\Cursor\cursor_config.json` | 1. 打开配置文件<br>2. 添加上述配置<br>3. 重启 Cursor |
|
|
55
|
+
| Trae IDE | `.trae/mcp.json`(项目根目录) | 1. 打开配置文件<br>2. 添加上述配置<br>3. 重启 Trae IDE |
|
|
56
|
+
| 其他支持 MCP 的 IDE | 参考官方文档 | 1. 找到 MCP 配置文件<br>2. 添加上述配置<br>3. 重启 IDE |
|
|
57
57
|
|
|
58
58
|
### 2.3 验证配置
|
|
59
59
|
|
|
@@ -67,38 +67,38 @@ pnpm install
|
|
|
67
67
|
|
|
68
68
|
### 3.1 工具(Tools)
|
|
69
69
|
|
|
70
|
-
| 工具名称
|
|
71
|
-
|
|
72
|
-
| `search_documents`
|
|
73
|
-
| `get_component_list`
|
|
74
|
-
| `get_component_details`
|
|
75
|
-
| `search_and_get_details` | 搜索并获取组件详情 | `query: string`, `limit?: number` | 匹配的组件列表(含详情)
|
|
70
|
+
| 工具名称 | 描述 | 参数 | 返回值 |
|
|
71
|
+
| ------------------------ | ------------------ | --------------------------------- | ---------------------------------- |
|
|
72
|
+
| `search_documents` | 搜索组件文档 | `query: string` | 匹配的组件列表 |
|
|
73
|
+
| `get_component_list` | 获取所有组件列表 | 无 | 所有组件基本信息 |
|
|
74
|
+
| `get_component_details` | 获取组件详情 | `componentName: string` | 组件详细信息(属性、事件、插槽等) |
|
|
75
|
+
| `search_and_get_details` | 搜索并获取组件详情 | `query: string`, `limit?: number` | 匹配的组件列表(含详情) |
|
|
76
76
|
|
|
77
77
|
### 3.2 资源(Resources)
|
|
78
78
|
|
|
79
|
-
| 资源 URI
|
|
80
|
-
|
|
81
|
-
| `status://exploria-ui-server`
|
|
82
|
-
| `docs://exploria-ui-api`
|
|
83
|
-
| `components://exploria-ui-list` | 组件列表
|
|
79
|
+
| 资源 URI | 描述 | 返回值 |
|
|
80
|
+
| ------------------------------- | ---------- | -------------------------- |
|
|
81
|
+
| `status://exploria-ui-server` | 服务器状态 | 运行状态、版本、运行时间等 |
|
|
82
|
+
| `docs://exploria-ui-api` | API 文档 | 完整 API 文档 |
|
|
83
|
+
| `components://exploria-ui-list` | 组件列表 | 所有组件基本信息 |
|
|
84
84
|
|
|
85
85
|
### 3.3 提示(Prompts)
|
|
86
86
|
|
|
87
|
-
| 提示名称
|
|
88
|
-
|
|
89
|
-
| `component_documentation` | 生成组件文档模板 | `componentName: string`
|
|
90
|
-
| `usage_example`
|
|
87
|
+
| 提示名称 | 描述 | 参数 | 返回值 |
|
|
88
|
+
| ------------------------- | ---------------- | -------------------------------------------- | ---------------- |
|
|
89
|
+
| `component_documentation` | 生成组件文档模板 | `componentName: string` | 组件文档模板 |
|
|
90
|
+
| `usage_example` | 生成组件使用示例 | `componentName: string`, `scenario?: string` | 组件使用示例代码 |
|
|
91
91
|
|
|
92
92
|
## 4. 项目架构
|
|
93
93
|
|
|
94
94
|
### 4.1 核心模块
|
|
95
95
|
|
|
96
|
-
| 模块
|
|
97
|
-
|
|
98
|
-
| **Tools**
|
|
96
|
+
| 模块 | 功能 |
|
|
97
|
+
| ------------- | -------------------------------------- |
|
|
98
|
+
| **Tools** | 可执行功能(搜索文档、获取组件详情等) |
|
|
99
99
|
| **Resources** | 提供只读数据(服务器状态、API 文档等) |
|
|
100
|
-
| **Prompts**
|
|
101
|
-
| **Utils**
|
|
100
|
+
| **Prompts** | 预定义模板(生成文档、使用示例等) |
|
|
101
|
+
| **Utils** | 工具类(文档解析器等) |
|
|
102
102
|
|
|
103
103
|
### 4.2 项目结构
|
|
104
104
|
|
|
@@ -132,9 +132,19 @@ src/
|
|
|
132
132
|
pnpm build
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
### 5.2
|
|
135
|
+
### 5.2 本地运行
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
#### 在 mcp-server 目录下运行(推荐):
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# 构建 MCP Server
|
|
141
|
+
pnpm run build
|
|
142
|
+
|
|
143
|
+
# 运行构建后的服务
|
|
144
|
+
pnpm run start
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### 或在项目根目录执行:
|
|
138
148
|
|
|
139
149
|
```bash
|
|
140
150
|
# 开发模式
|
|
@@ -147,6 +157,28 @@ pnpm mcp:build
|
|
|
147
157
|
pnpm mcp:start
|
|
148
158
|
```
|
|
149
159
|
|
|
160
|
+
### 5.3 使用 MCP Inspector 调试
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# 使用 MCP Inspector 启动服务,方便调试
|
|
164
|
+
npx -y @modelcontextprotocol/inspector node dist/index.js
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 5.4 故障排除
|
|
168
|
+
|
|
169
|
+
1. **连接失败或 "Command not found" 错误**:
|
|
170
|
+
- 确保已正确构建项目:`pnpm run build`
|
|
171
|
+
- 检查当前工作目录,确保在正确的位置运行命令
|
|
172
|
+
- 查看控制台输出的错误信息,针对性解决
|
|
173
|
+
|
|
174
|
+
2. **JSON 解析错误**:
|
|
175
|
+
- 确保所有日志输出已重定向到 stderr(本项目已自动处理)
|
|
176
|
+
- 检查是否有其他进程占用了 stdio
|
|
177
|
+
|
|
178
|
+
3. **文档未找到**:
|
|
179
|
+
- 确保文档已正确复制到 `public` 目录
|
|
180
|
+
- 检查 `docsRoot` 配置是否正确
|
|
181
|
+
|
|
150
182
|
## 6. 扩展指南
|
|
151
183
|
|
|
152
184
|
### 6.1 添加新工具
|
|
@@ -169,13 +201,13 @@ pnpm mcp:start
|
|
|
169
201
|
|
|
170
202
|
## 7. 技术栈
|
|
171
203
|
|
|
172
|
-
| 技术
|
|
173
|
-
|
|
174
|
-
| `@modelcontextprotocol/sdk` | 官方 MCP TypeScript SDK
|
|
175
|
-
| `zod`
|
|
176
|
-
| `tsx`
|
|
177
|
-
| `typescript`
|
|
178
|
-
| `pnpm`
|
|
204
|
+
| 技术 | 用途 |
|
|
205
|
+
| --------------------------- | ------------------------ |
|
|
206
|
+
| `@modelcontextprotocol/sdk` | 官方 MCP TypeScript SDK |
|
|
207
|
+
| `zod` | 工具参数运行时类型校验 |
|
|
208
|
+
| `tsx` | 直接运行 TypeScript 代码 |
|
|
209
|
+
| `typescript` | 类型安全 |
|
|
210
|
+
| `pnpm` | 包管理 |
|
|
179
211
|
|
|
180
212
|
## 8. 协议兼容性
|
|
181
213
|
|