@szc-ft/mcp-szcd-client 0.11.6 → 0.12.0
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 +143 -0
- package/agents/build.js +331 -0
- package/agents/platforms.json +47 -0
- package/agents/qwen-extension/agents/szcd-component-expert.md +165 -0
- package/agents/src/szcd-component-expert.md +352 -0
- package/agents/src/tools.json +112 -0
- package/agents/szcd-component-expert.md +79 -98
- package/agents/szcd-component-expert.qoder.md +226 -0
- package/agents/szcd-component-expert.trae.md +23 -8
- package/commands/szcd-mcp-url.md +2 -2
- package/package.json +8 -5
- package/scripts/lib/claude-code.js +30 -30
- package/scripts/lib/qoder.js +43 -32
- package/scripts/lib/qwen-code.js +14 -14
- package/scripts/lib/trae-cli.js +22 -22
- package/scripts/lib/trae-ide.js +12 -12
- package/scripts/postinstall.js +4 -4
- package/skill/SKILL.md +288 -358
package/skill/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: szcd-component-helper
|
|
3
|
-
description: 帮助用户查询和了解 szcd 项目中的组件信息,包括 Cover 层组件、Wrapper 层组件、Ant Design 组件、ProComponents
|
|
3
|
+
description: 帮助用户查询和了解 szcd 项目中的组件信息,包括 Cover 层组件、Wrapper 层组件、Ant Design 组件、ProComponents 以及复合组件。支持组件搜索、详情查询、使用示例搜索、文件读取、设计稿图片分析、样式注入指南、架构概览、组件依赖分析、Props链解析、Swagger联调、CODING Issue 获取等。当用户需要了解 szcd 项目的组件结构、查看组件实现、寻找组件使用示例、分析设计稿、联调API、获取需求详情时,应使用此技能。它是一个前端组件库,全名"@szc-ft/szcd"。这是一个客户端 skill,通过 MCP 协议(SSE 或 HTTP)连接到远程 MCP 服务器。
|
|
4
4
|
compatibility:
|
|
5
5
|
tools:
|
|
6
6
|
- web_search
|
|
@@ -19,7 +19,7 @@ compatibility:
|
|
|
19
19
|
|
|
20
20
|
**重要说明**:这是一个客户端 skill,通过 MCP 协议(SSE 或 HTTP)连接到远程 MCP 服务器。服务器由管理员维护,包含源码和数据。
|
|
21
21
|
|
|
22
|
-
**版本**:v0.
|
|
22
|
+
**版本**:v0.11.6 - 新增架构概览和组件依赖分析工具;新增深度 Props 链解析和批量文档生成工具;新增 Swagger 联调工具(拉取API + 联调测试);新增 CODING Issue 获取和配置管理工具;包含设计稿图片分析(视觉代理/兜底方案)、样式注入指南等全部功能
|
|
23
23
|
|
|
24
24
|
## 架构说明
|
|
25
25
|
|
|
@@ -28,26 +28,26 @@ compatibility:
|
|
|
28
28
|
│ 连接方式(三选一) │
|
|
29
29
|
├─────────────────────────────────────────────────────────────┤
|
|
30
30
|
│ │
|
|
31
|
-
│ 方式1: 本地直连 (stdio)
|
|
31
|
+
│ 方式1: 本地直连 (stdio) │
|
|
32
32
|
│ ┌─────────────┐ stdio ┌─────────────────────────┐│
|
|
33
33
|
│ │ IDE/AI │ ◄─────────────►│ szcd-mcp-server ││
|
|
34
34
|
│ │ Client │ │ (本地运行) ││
|
|
35
35
|
│ └─────────────┘ └─────────────────────────┘│
|
|
36
36
|
│ │
|
|
37
|
-
│ 方式2:
|
|
38
|
-
│ ┌─────────────┐ SSE ┌─────────────────────────┐│
|
|
39
|
-
│ │ IDE/AI │ ◄────────────►│ MCP Server (SSE 模式) ││
|
|
40
|
-
│ │ Client │ GET /sse │ 管理员机器 ││
|
|
41
|
-
│ │ │ POST /message│ (源码 + 数据) ││
|
|
42
|
-
│ └─────────────┘ └─────────────────────────┘│
|
|
43
|
-
│ │
|
|
44
|
-
│ 方式2b: Streamable HTTP 远程连接(Trae CLI 兼容) │
|
|
37
|
+
│ 方式2: Streamable HTTP 远程连接 — 推荐 │
|
|
45
38
|
│ ┌─────────────┐ HTTP ┌─────────────────────────┐ │
|
|
46
39
|
│ │ IDE/AI │ ◄───────────►│ MCP Server (HTTP 模式) │ │
|
|
47
40
|
│ │ Client │ POST /mcp │ 管理员机器 │ │
|
|
48
41
|
│ │ │ │ (源码 + 数据) │ │
|
|
49
42
|
│ └─────────────┘ └─────────────────────────┘ │
|
|
50
43
|
│ │
|
|
44
|
+
│ 方式2b: SSE 远程连接(旧客户端向后兼容) │
|
|
45
|
+
│ ┌─────────────┐ SSE ┌─────────────────────────┐│
|
|
46
|
+
│ │ IDE/AI │ ◄────────────►│ MCP Server (SSE 模式) ││
|
|
47
|
+
│ │ Client │ GET /sse │ 管理员机器 ││
|
|
48
|
+
│ │ │ POST /message│ (源码 + 数据) ││
|
|
49
|
+
│ └─────────────┘ └─────────────────────────┘│
|
|
50
|
+
│ │
|
|
51
51
|
│ 方式3: 代理桥接 (向后兼容) │
|
|
52
52
|
│ ┌─────────────┐ stdio ┌───────────┐ SSE/HTTP ┌─────┐│
|
|
53
53
|
│ │ IDE/AI │◄───────►│mcp-proxy │◄──────────►│Server││
|
|
@@ -56,379 +56,236 @@ compatibility:
|
|
|
56
56
|
└─────────────────────────────────────────────────────────────┘
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## 可用工具(23个)
|
|
60
60
|
|
|
61
61
|
### 复合组件工具 (Other Components)
|
|
62
62
|
|
|
63
|
-
#### 1.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
##### Trae CLI 调用示例
|
|
69
|
-
```bash
|
|
70
|
-
trae -m 'Call MCP tool list_other_components' --tool-allowance '*:*'
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
##### Claude Code 调用示例
|
|
74
|
-
```
|
|
75
|
-
请列出项目中的复合组件。
|
|
76
|
-
```
|
|
63
|
+
#### 1. get_other_component
|
|
64
|
+
**功能**:根据组件名获取实现路径、types、docs、透传目标与 props 列表(若可解析),同时返回组件使用示例
|
|
65
|
+
**参数**:
|
|
66
|
+
- `name` (string, required): 组件名称
|
|
77
67
|
|
|
78
|
-
#####
|
|
68
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
79
69
|
```
|
|
80
|
-
|
|
70
|
+
请获取 Query 组件的详细信息。
|
|
81
71
|
```
|
|
82
72
|
|
|
83
|
-
#### 2. get_other_component
|
|
84
|
-
**功能**:根据组件名获取实现路径、types、docs、透传目标与 props 列表
|
|
85
|
-
**参数**:
|
|
86
|
-
- `name` (string, required): 组件名称
|
|
87
|
-
|
|
88
73
|
##### Trae CLI 调用示例
|
|
89
74
|
```bash
|
|
90
75
|
trae -m 'Call MCP tool get_other_component with name "Query"' --tool-allowance '*:*'
|
|
91
76
|
```
|
|
92
77
|
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
请获取Query组件的详细信息。
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
##### Qwen Code 调用示例
|
|
99
|
-
```
|
|
100
|
-
请获取Query组件的详细信息。
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
#### 3. search_component_examples
|
|
78
|
+
#### 2. search_component_examples
|
|
104
79
|
**功能**:在仓库内搜索组件名的用法片段(md/js/ts/tsx)
|
|
105
80
|
**参数**:
|
|
106
81
|
- `name` (string, required): 组件名称
|
|
107
82
|
- `maxResults` (number, optional, default: 20): 最大结果数,范围1-50
|
|
108
83
|
|
|
109
|
-
#####
|
|
110
|
-
```bash
|
|
111
|
-
trae -m 'Call MCP tool search_component_examples with name "TableOrList" maxResults 10' --tool-allowance '*:*'
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
##### Claude Code 调用示例
|
|
84
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
115
85
|
```
|
|
116
|
-
请搜索TableOrList组件的使用示例,最多返回10个。
|
|
86
|
+
请搜索 TableOrList 组件的使用示例,最多返回10个。
|
|
117
87
|
```
|
|
118
88
|
|
|
119
|
-
##### Qwen Code 调用示例
|
|
120
|
-
```
|
|
121
|
-
请搜索TableOrList组件的使用示例,最多返回10个。
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Cover层组件工具
|
|
125
|
-
|
|
126
|
-
#### 4. list_cover_components
|
|
127
|
-
**功能**:列出 src/components/cover/ 目录下的 Cover 层封装组件
|
|
128
|
-
**参数**:无
|
|
129
|
-
|
|
130
89
|
##### Trae CLI 调用示例
|
|
131
90
|
```bash
|
|
132
|
-
trae -m 'Call MCP tool
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
##### Claude Code 调用示例
|
|
136
|
-
```
|
|
137
|
-
请列出Cover层的封装组件。
|
|
91
|
+
trae -m 'Call MCP tool search_component_examples with name "TableOrList" maxResults 10' --tool-allowance '*:*'
|
|
138
92
|
```
|
|
139
93
|
|
|
140
|
-
|
|
141
|
-
```
|
|
142
|
-
请列出Cover层的封装组件。
|
|
143
|
-
```
|
|
94
|
+
### Cover层组件工具
|
|
144
95
|
|
|
145
|
-
####
|
|
146
|
-
**功能**:获取 Cover 层组件的详细信息,包括实现路径、Props
|
|
96
|
+
#### 3. get_cover_component
|
|
97
|
+
**功能**:获取 Cover 层组件的详细信息,包括实现路径、Props 定义、透传目标、准确Props文档、使用示例
|
|
147
98
|
**参数**:
|
|
148
99
|
- `name` (string, required): 组件名称
|
|
149
100
|
|
|
150
|
-
#####
|
|
151
|
-
```bash
|
|
152
|
-
trae -m 'Call MCP tool get_cover_component with name "Button"' --tool-allowance '*:*'
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
##### Claude Code 调用示例
|
|
156
|
-
```
|
|
157
|
-
请获取Cover层Button组件的详细信息。
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
##### Qwen Code 调用示例
|
|
101
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
161
102
|
```
|
|
162
|
-
请获取Cover层Button组件的详细信息。
|
|
103
|
+
请获取 Cover 层 Button 组件的详细信息。
|
|
163
104
|
```
|
|
164
105
|
|
|
165
|
-
### Wrapper层组件工具
|
|
166
|
-
|
|
167
|
-
#### 6. list_wrapper_components
|
|
168
|
-
**功能**:列出 src/components/wrappers/ 目录下的 Wrapper 层业务组件
|
|
169
|
-
**参数**:无
|
|
170
|
-
|
|
171
106
|
##### Trae CLI 调用示例
|
|
172
107
|
```bash
|
|
173
|
-
trae -m 'Call MCP tool
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
##### Claude Code 调用示例
|
|
177
|
-
```
|
|
178
|
-
请列出Wrapper层的业务组件。
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
##### Qwen Code 调用示例
|
|
182
|
-
```
|
|
183
|
-
请列出Wrapper层的业务组件。
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### ProPackages组件工具
|
|
187
|
-
|
|
188
|
-
#### 7. list_pro_package_components
|
|
189
|
-
**功能**:列出 pro-packages/ 目录下的 ProPackages 组件封装
|
|
190
|
-
**参数**:无
|
|
191
|
-
|
|
192
|
-
##### Trae CLI 调用示例
|
|
193
|
-
```bash
|
|
194
|
-
trae -m 'Call MCP tool list_pro_package_components' --tool-allowance '*:*'
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
##### Claude Code 调用示例
|
|
198
|
-
```
|
|
199
|
-
请列出ProPackages的组件封装。
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
##### Qwen Code 调用示例
|
|
203
|
-
```
|
|
204
|
-
请列出ProPackages的组件封装。
|
|
108
|
+
trae -m 'Call MCP tool get_cover_component with name "Button"' --tool-allowance '*:*'
|
|
205
109
|
```
|
|
206
110
|
|
|
207
111
|
### Ant Design组件工具
|
|
208
112
|
|
|
209
|
-
####
|
|
113
|
+
#### 4. list_antd_components
|
|
210
114
|
**功能**:列出 Ant Design 组件的分类概览和各分类下的组件数量
|
|
211
115
|
**参数**:无
|
|
212
116
|
|
|
213
|
-
#####
|
|
214
|
-
```bash
|
|
215
|
-
trae -m 'Call MCP tool list_antd_components' --tool-allowance '*:*'
|
|
117
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
216
118
|
```
|
|
217
|
-
|
|
218
|
-
##### Claude Code 调用示例
|
|
219
|
-
```
|
|
220
|
-
请列出Ant Design组件的分类概览。
|
|
119
|
+
请列出 Ant Design 组件的分类概览。
|
|
221
120
|
```
|
|
222
121
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
请列出Ant Design组件的分类概览。
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
#### 9. list_antd_components_by_category
|
|
229
|
-
**功能**:按分类列出 Ant Design 组件
|
|
122
|
+
#### 5. list_antd_components_by_category
|
|
123
|
+
**功能**:按分类列出 Ant Design 组件(通用、布局、导航、数据录入、数据展示、反馈等)
|
|
230
124
|
**参数**:
|
|
231
125
|
- `category` (enum, optional, default: "通用"): 组件分类,可选值:通用、布局、导航、数据录入、数据展示、反馈、其他
|
|
232
126
|
|
|
233
|
-
#####
|
|
234
|
-
```bash
|
|
235
|
-
trae -m 'Call MCP tool list_antd_components_by_category with category "数据录入"' --tool-allowance '*:*'
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
##### Claude Code 调用示例
|
|
239
|
-
```
|
|
240
|
-
请按分类列出Ant Design的数据录入组件。
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
##### Qwen Code 调用示例
|
|
127
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
244
128
|
```
|
|
245
|
-
请按分类列出Ant Design的数据录入组件。
|
|
129
|
+
请按分类列出 Ant Design 的数据录入组件。
|
|
246
130
|
```
|
|
247
131
|
|
|
248
|
-
####
|
|
249
|
-
**功能**:获取 Ant Design
|
|
132
|
+
#### 6. get_antd_component
|
|
133
|
+
**功能**:获取 Ant Design 组件的详细信息,包括中文名、描述、API 文档链接和 Props 列表
|
|
250
134
|
**参数**:
|
|
251
135
|
- `name` (string, required): 组件名称
|
|
252
136
|
|
|
253
|
-
#####
|
|
254
|
-
```bash
|
|
255
|
-
trae -m 'Call MCP tool get_antd_component with name "Input"' --tool-allowance '*:*'
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
##### Claude Code 调用示例
|
|
259
|
-
```
|
|
260
|
-
请获取Ant Design Input组件的详细信息。
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
##### Qwen Code 调用示例
|
|
137
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
264
138
|
```
|
|
265
|
-
请获取Ant Design Input组件的详细信息。
|
|
139
|
+
请获取 Ant Design Input 组件的详细信息。
|
|
266
140
|
```
|
|
267
141
|
|
|
268
142
|
### ProComponents组件工具
|
|
269
143
|
|
|
270
|
-
####
|
|
271
|
-
**功能**:列出 ProComponents
|
|
144
|
+
#### 7. list_pro_components
|
|
145
|
+
**功能**:列出 ProComponents 组件的分类概览,包括 ProTable、ProForm、ProLayout 等高级组件
|
|
272
146
|
**参数**:无
|
|
273
147
|
|
|
274
|
-
#####
|
|
275
|
-
```bash
|
|
276
|
-
trae -m 'Call MCP tool list_pro_components' --tool-allowance '*:*'
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
##### Claude Code 调用示例
|
|
280
|
-
```
|
|
281
|
-
请列出ProComponents的分类概览。
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
##### Qwen Code 调用示例
|
|
148
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
285
149
|
```
|
|
286
|
-
请列出ProComponents的分类概览。
|
|
150
|
+
请列出 ProComponents 的分类概览。
|
|
287
151
|
```
|
|
288
152
|
|
|
289
|
-
####
|
|
290
|
-
**功能**:按分类列出 ProComponents
|
|
153
|
+
#### 8. list_pro_components_by_category
|
|
154
|
+
**功能**:按分类列出 ProComponents 组件(数据录入、数据展示、布局等)
|
|
291
155
|
**参数**:
|
|
292
156
|
- `category` (enum, optional, default: "数据录入"): 组件分类,可选值:数据录入、数据展示、布局、反馈
|
|
293
157
|
|
|
294
|
-
#####
|
|
295
|
-
```bash
|
|
296
|
-
trae -m 'Call MCP tool list_pro_components_by_category with category "数据展示"' --tool-allowance '*:*'
|
|
158
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
297
159
|
```
|
|
298
|
-
|
|
299
|
-
##### Claude Code 调用示例
|
|
300
|
-
```
|
|
301
|
-
请按分类列出ProComponents的数据展示组件。
|
|
160
|
+
请按分类列出 ProComponents 的数据展示组件。
|
|
302
161
|
```
|
|
303
162
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
请按分类列出ProComponents的数据展示组件。
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
#### 13. get_pro_component
|
|
310
|
-
**功能**:获取 ProComponents 组件的详细信息
|
|
163
|
+
#### 9. get_pro_component
|
|
164
|
+
**功能**:获取 ProComponents 组件的详细信息,包括特性说明、API 文档和 Props 列表
|
|
311
165
|
**参数**:
|
|
312
166
|
- `name` (string, required): 组件名称
|
|
313
167
|
|
|
314
|
-
#####
|
|
315
|
-
```bash
|
|
316
|
-
trae -m 'Call MCP tool get_pro_component with name "ProTable"' --tool-allowance '*:*'
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
##### Claude Code 调用示例
|
|
320
|
-
```
|
|
321
|
-
请获取ProTable组件的详细信息。
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
##### Qwen Code 调用示例
|
|
168
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
325
169
|
```
|
|
326
|
-
请获取ProTable组件的详细信息。
|
|
170
|
+
请获取 ProTable 组件的详细信息。
|
|
327
171
|
```
|
|
328
172
|
|
|
329
|
-
###
|
|
173
|
+
### 全局搜索工具
|
|
330
174
|
|
|
331
|
-
####
|
|
332
|
-
|
|
175
|
+
#### 10. search_all_components
|
|
176
|
+
**功能**:全局搜索所有层级的组件(Cover、Wrapper、AntD、ProComponents等),支持按类型筛选
|
|
333
177
|
**参数**:
|
|
334
178
|
- `keyword` (string, required): 搜索关键词
|
|
335
179
|
- `type` (enum, optional): 按类型筛选,可选值:cover、wrapper、pro-package、antd、pro-components、other
|
|
336
180
|
|
|
337
|
-
#####
|
|
338
|
-
```bash
|
|
339
|
-
trae -m 'Call MCP tool search_all_components with keyword "form" type "pro-components"' --tool-allowance '*:*'
|
|
181
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
340
182
|
```
|
|
183
|
+
请搜索包含"form"的 ProComponents 组件。
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 架构与依赖工具
|
|
341
187
|
|
|
342
|
-
|
|
188
|
+
#### 11. get_architecture_overview
|
|
189
|
+
**功能**:获取 szcd 组件库的分层架构图、层级关系、推荐使用顺序和模板组合模式。帮助理解项目从 Ant Design → Cover → Wrapper → ProPackage → 复合组件 → 模板 的7层封装架构,以及 TreeQueryTable/QueryTabsTables 等页面模板的组合方式。含 LLM 常见映射错误的修正提示
|
|
190
|
+
**参数**:
|
|
191
|
+
- `detail` (enum, optional, default: "summary"): 返回粒度
|
|
192
|
+
- `summary` — 层级概览+模板模式+LLM提示
|
|
193
|
+
- `full` — 含所有层组件列表详情
|
|
194
|
+
|
|
195
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
343
196
|
```
|
|
344
|
-
|
|
197
|
+
请提供 szcd 组件库的架构概览。
|
|
345
198
|
```
|
|
346
199
|
|
|
347
|
-
##### Qwen Code 调用示例
|
|
348
200
|
```
|
|
349
|
-
|
|
201
|
+
请获取完整的组件库架构详情,包含所有层级的组件列表。
|
|
350
202
|
```
|
|
351
203
|
|
|
352
|
-
####
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
204
|
+
#### 12. get_component_dependencies
|
|
205
|
+
**功能**:查询某个 szcd 组件的依赖关系图:它依赖哪些 szcd 组件(及外部库),哪些 szcd 组件/模板依赖它。包含组件间的组合关系(import/slot/hook/composition)、模板中的使用角色、以及 LLM 常见映射错误的修正提示
|
|
206
|
+
**参数**:
|
|
207
|
+
- `name` (string, required): 组件名称(如 TemplateMode, LeftTree, TableOrList, Query 等)
|
|
208
|
+
- `layer` (enum, optional): 组件所在层级,可选值:cover、wrapper、pro-package、other。不传时自动推测
|
|
209
|
+
- `direction` (enum, optional, default: "both"): 查询方向
|
|
210
|
+
- `depends-on` — 它依赖谁
|
|
211
|
+
- `depended-by` — 谁依赖它
|
|
212
|
+
- `both` — 双向
|
|
213
|
+
- `includeExternal` (boolean, optional, default: false): 是否包含外部依赖(antd/ProComponents/第三方库),默认仅返回 szcd 组件间关系
|
|
214
|
+
- `includeHooks` (boolean, optional, default: true): 是否包含 hooks 依赖关系(useLeftTree, useTable 等)
|
|
360
215
|
|
|
361
|
-
##### Claude Code 调用示例
|
|
216
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
362
217
|
```
|
|
363
|
-
|
|
218
|
+
请查询 TemplateMode 组件的依赖关系。
|
|
364
219
|
```
|
|
365
220
|
|
|
366
|
-
##### Qwen Code 调用示例
|
|
367
221
|
```
|
|
368
|
-
|
|
222
|
+
请查询谁依赖了 LeftTree 组件。
|
|
369
223
|
```
|
|
370
224
|
|
|
371
225
|
### 文件操作工具
|
|
372
226
|
|
|
373
|
-
####
|
|
227
|
+
#### 13. read_file
|
|
374
228
|
**功能**:读取仓库内文件(相对路径)
|
|
375
229
|
**参数**:
|
|
376
230
|
- `path` (string, required): 文件相对路径
|
|
377
231
|
- `maxChars` (number, optional, default: 20000): 最大字符数,范围200-200000
|
|
378
232
|
|
|
379
|
-
#####
|
|
380
|
-
```bash
|
|
381
|
-
trae -m 'Call MCP tool read_file with path "src/other/components/Query/index.tsx" maxChars 5000' --tool-allowance '*:*'
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
##### Claude Code 调用示例
|
|
233
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
385
234
|
```
|
|
386
|
-
请读取src/other/components/Query/index.tsx文件内容,最多5000个字符。
|
|
235
|
+
请读取 src/other/components/Query/index.tsx 文件内容,最多5000个字符。
|
|
387
236
|
```
|
|
388
237
|
|
|
389
|
-
|
|
390
|
-
```
|
|
391
|
-
请读取src/other/components/Query/index.tsx文件内容,最多5000个字符。
|
|
392
|
-
```
|
|
238
|
+
### 准确文档工具
|
|
393
239
|
|
|
394
|
-
####
|
|
395
|
-
**功能**:获取复合组件的准确Props
|
|
240
|
+
#### 14. get_accurate_component_doc
|
|
241
|
+
**功能**:获取复合组件的准确Props文档,包含透传机制的详细说明(特别是Query组件的type/valueType双重透传机制)。同时返回 mode-packages 下的使用文档
|
|
396
242
|
**参数**:
|
|
397
243
|
- `name` (string, required): 组件名称
|
|
398
244
|
|
|
399
|
-
#####
|
|
400
|
-
```
|
|
401
|
-
|
|
245
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
246
|
+
```
|
|
247
|
+
请获取 Query 组件的准确文档,包含透传机制说明。
|
|
402
248
|
```
|
|
403
249
|
|
|
404
|
-
|
|
250
|
+
#### 15. resolve_props_chain
|
|
251
|
+
**功能**:递归解析指定组件的完整 Props 链:从顶层到所有透传组件,逐层提取自有 Props、透传目标和继承关系,用于补全组件文档
|
|
252
|
+
**参数**:
|
|
253
|
+
- `name` (string, required): 组件名称(如 FormItemOrDetailItem、Query、TableOrList)
|
|
254
|
+
- `layer` (enum, optional, default: "other"): 组件所在层级,可选值:other、cover、wrapper、pro-package
|
|
255
|
+
- `maxDepth` (number, optional, default: 3): 最大递归深度,范围1-5
|
|
256
|
+
|
|
257
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
405
258
|
```
|
|
406
|
-
|
|
259
|
+
请深度解析 Query 组件的 Props 链。
|
|
407
260
|
```
|
|
408
261
|
|
|
409
|
-
##### Qwen Code 调用示例
|
|
410
262
|
```
|
|
411
|
-
|
|
263
|
+
请递归解析 FormItemOrDetailItem 的完整 Props 链,最大深度5。
|
|
412
264
|
```
|
|
413
265
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
#### 18. refresh_component_docs
|
|
417
|
-
**功能**:刷新 Ant Design / ProComponents 组件文档缓存
|
|
266
|
+
#### 16. regenerate_accurate_docs
|
|
267
|
+
**功能**:使用深度Props链解析,批量生成或更新组件的准确Props文档(含类型、必填、继承链、透传详情)。已有文档会智能合并保留手写独有内容。
|
|
418
268
|
**参数**:
|
|
419
|
-
- `
|
|
269
|
+
- `componentName` (string, optional): 指定组件名,只生成该组件的文档
|
|
270
|
+
- `layer` (enum, optional): 指定层级,生成该层级所有组件的文档,可选值:other、cover、wrapper、pro-package
|
|
420
271
|
|
|
421
|
-
#####
|
|
422
|
-
```
|
|
423
|
-
|
|
272
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
273
|
+
```
|
|
274
|
+
请重新生成 Query 组件的准确 Props 文档。
|
|
424
275
|
```
|
|
425
276
|
|
|
426
|
-
##### Claude Code 调用示例
|
|
427
277
|
```
|
|
428
|
-
|
|
278
|
+
请批量生成 other 层级所有组件的准确 Props 文档。
|
|
429
279
|
```
|
|
430
280
|
|
|
431
|
-
|
|
281
|
+
### 缓存管理工具
|
|
282
|
+
|
|
283
|
+
#### 17. refresh_component_docs
|
|
284
|
+
**功能**:刷新 Ant Design / ProComponents 组件文档缓存,从本地类型定义和官方文档站重新获取
|
|
285
|
+
**参数**:
|
|
286
|
+
- `source` (enum, optional, default: "all"): 刷新来源,可选值:antd、pro-components、all
|
|
287
|
+
|
|
288
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
432
289
|
```
|
|
433
290
|
请刷新所有组件文档缓存。
|
|
434
291
|
```
|
|
@@ -439,7 +296,7 @@ trae -m 'Call MCP tool refresh_component_docs with source "all"' --tool-allowanc
|
|
|
439
296
|
>
|
|
440
297
|
> 当用户的 IDE/AI 是纯文本模型(无法直接看设计稿截图)时,由 MCP 服务器调用多模态模型代为"看图",将图片内容转化为结构化文本返回给用户 LLM,让用户 LLM 基于文字描述生成代码。如果用户的 LLM 本身支持图片输入(如 Claude 4、GPT-4o),则**不需要**使用此工具。
|
|
441
298
|
|
|
442
|
-
####
|
|
299
|
+
#### 18. analyze_design_image
|
|
443
300
|
**功能**:分析UI设计稿图片,将视觉设计转化为结构化文本描述。支持三通道提取,追求设计稿样式的高度还原:
|
|
444
301
|
|
|
445
302
|
- **通道1: ConfigProvider Token** — 对齐 tokenConfig.json 结构,精确提取全局 Token 和组件级 Token,自动对比 szcd 默认值生成 themeDiff,输出可直接使用的 `<ConfigProvider theme={...}>` 配置代码
|
|
@@ -485,6 +342,11 @@ trae -m 'Call MCP tool refresh_component_docs with source "all"' --tool-allowanc
|
|
|
485
342
|
- **visualDetails** — 渐变、滚动条、遮罩、状态变体等视觉细节(仅 pixel_perfect 模式)
|
|
486
343
|
- **fidelityScore** — 还原度评分(0-100),含 Token 覆盖率、CSS 覆盖补充率、未覆盖场景清单
|
|
487
344
|
|
|
345
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
346
|
+
```
|
|
347
|
+
请分析 docs/designs/user-list.png 这张设计稿,使用 pixel_perfect 模式,输出还原代码。
|
|
348
|
+
```
|
|
349
|
+
|
|
488
350
|
##### Trae CLI 调用示例
|
|
489
351
|
```bash
|
|
490
352
|
# 完整分析(通道1+2)
|
|
@@ -494,19 +356,9 @@ trae -m 'Call MCP tool analyze_design_image with imageSource "docs/designs/user-
|
|
|
494
356
|
trae -m 'Call MCP tool analyze_design_image with imageSource "docs/designs/user-list.png" sourceType "file_path" analysisType "pixel_perfect" outputFormat "restoration_code" pageContext "用户管理列表页" targetLibrary "szcd"' --tool-allowance '*:*'
|
|
495
357
|
```
|
|
496
358
|
|
|
497
|
-
##### Claude Code 调用示例
|
|
498
|
-
```
|
|
499
|
-
请分析 docs/designs/user-list.png 这张设计稿,使用 pixel_perfect 模式,输出还原代码。
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
##### Qwen Code 调用示例
|
|
503
|
-
```
|
|
504
|
-
请分析 docs/designs/user-list.png 这张设计稿,识别页面布局和组件,匹配 szcd 组件库,使用 pixel_perfect 模式获取最高还原度。
|
|
505
|
-
```
|
|
506
|
-
|
|
507
359
|
### 样式注入指南工具
|
|
508
360
|
|
|
509
|
-
####
|
|
361
|
+
#### 19. get_style_injection_guide
|
|
510
362
|
**功能**:查询 szcd 复合组件的样式注入方法。返回指定组件的可用样式 props、注入方式(ModeStyle/TreeBoxStyle/btnStyle/inline style等)、代码示例,以及组件嵌套时的 CSS 穿透路径和智能分配策略。
|
|
511
363
|
|
|
512
364
|
**适用场景**:
|
|
@@ -531,26 +383,84 @@ trae -m 'Call MCP tool analyze_design_image with imageSource "docs/designs/user-
|
|
|
531
383
|
- TemplateMode 的 ModeStyle 可穿透到子组件(通过 `.leftContentBox` / `.rightContentBox_top` / `.rightContentBox_bottom` 定位)
|
|
532
384
|
- ModelOrDrawer DOM 挂载在 document.body,父级穿不透
|
|
533
385
|
|
|
534
|
-
#####
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
|
|
386
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
387
|
+
```
|
|
388
|
+
请查询 Query 组件的样式注入方法。
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
请查询 TemplateMode 和 Query 组件的样式注入指南,包括嵌套场景。
|
|
393
|
+
```
|
|
538
394
|
|
|
539
|
-
|
|
540
|
-
|
|
395
|
+
### Swagger 联调工具
|
|
396
|
+
|
|
397
|
+
#### 20. swagger_fetch_apis
|
|
398
|
+
**功能**:访问 Swagger 地址获取所有 API 内容。返回 API 分组(tags)、每个接口的路径/方法/参数/描述等信息,用于后续联调。支持 Basic Auth 鉴权。
|
|
399
|
+
**参数**:
|
|
400
|
+
- `swaggerUrl` (string, required): Swagger UI 地址,如 http://172.31.7.103:31689/dp-label/swagger-ui.html
|
|
401
|
+
- `username` (string, optional, default: "admin"): 鉴权用户名
|
|
402
|
+
- `password` (string, optional, default: ""): 鉴权密码
|
|
541
403
|
|
|
542
|
-
|
|
543
|
-
trae -m 'Call MCP tool get_style_injection_guide with componentNames ["TemplateMode", "Query"] includeSmartDistribute true cssOverrides [...]' --tool-allowance '*:*'
|
|
404
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
544
405
|
```
|
|
406
|
+
请拉取 http://172.31.7.103:31689/dp-label/swagger-ui.html 的所有 API。
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
#### 21. swagger_test_api
|
|
410
|
+
**功能**:对 Swagger 中获取的 API 进行联调测试。向目标接口发送请求并返回响应结果,用于验证接口可用性和调试。
|
|
411
|
+
**参数**:
|
|
412
|
+
- `url` (string, required): 完整请求地址,如 http://172.31.7.103:31689/dp-label/api/user/list
|
|
413
|
+
- `method` (enum, optional, default: "GET"): HTTP 请求方法,可选值:GET、POST、PUT、DELETE、PATCH
|
|
414
|
+
- `data` (object, optional, default: {}): 请求参数:GET/DELETE 为 query 参数,POST/PUT/PATCH 为请求体 JSON
|
|
415
|
+
- `headers` (object, optional, default: {}): 自定义请求头,如 { "Authorization": "Bearer xxx" }
|
|
545
416
|
|
|
546
|
-
##### Claude Code 调用示例
|
|
417
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
547
418
|
```
|
|
548
|
-
|
|
419
|
+
请测试 POST http://172.31.7.103:31689/dp-label/api/user/list 接口,参数为 { "page": 1, "size": 10 }。
|
|
549
420
|
```
|
|
550
421
|
|
|
551
|
-
|
|
422
|
+
### CODING Issue 工具
|
|
423
|
+
|
|
424
|
+
#### 22. coding_fetch_issue
|
|
425
|
+
**功能**:获取 CODING Issue(缺陷/需求)详情。支持两种认证方式:1) Cookie 模式(推荐,从浏览器开发者工具复制 Cookie 字符串);2) 账号密码模式(自动模拟登录流程)。如果已在 ~/.szcd-mcp-config.json 中配置了 CODING_BASE_URL 和 CODING_DEFAULT_PROJECT_ID,则 baseUrl 和 projectId 参数可省略。
|
|
426
|
+
**参数**:
|
|
427
|
+
- `issueCode` (string, required): Issue 编号,如 6249
|
|
428
|
+
- `baseUrl` (string, optional): CODING 基础地址。若 ~/.szcd-mcp-config.json 中配置了 CODING_BASE_URL,可省略
|
|
429
|
+
- `projectId` (string, optional): 项目 ID(数字)。若 ~/.szcd-mcp-config.json 中配置了 CODING_DEFAULT_PROJECT_ID,可省略
|
|
430
|
+
- `cookies` (string, optional): 浏览器 Cookie 字符串(从开发者工具 Network 面板复制)。若提供则优先使用 Cookie 模式
|
|
431
|
+
- `account` (string, optional): CODING 账号(邮箱)。与 password 同时提供时尝试自动登录
|
|
432
|
+
- `password` (string, optional): CODING 密码。与 account 同时提供时尝试自动登录
|
|
433
|
+
- `withDescriptionMarkup` (boolean, optional, default: true): 是否返回描述的富文本格式(HTML)
|
|
434
|
+
|
|
435
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
552
436
|
```
|
|
553
|
-
|
|
437
|
+
请获取 CODING Issue 6249 的详情。
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
请使用 Cookie 模式获取 CODING Issue 6249,Cookie 为 "session=xxx"。
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
#### 23. coding_config
|
|
445
|
+
**功能**:查看或设置 CODING 默认配置(保存在 ~/.szcd-mcp-config.json 中)。设置后,coding_fetch_issue 工具可省略对应的参数。注意:cookies 和 password 为敏感信息,查看时会被脱敏显示。
|
|
446
|
+
**参数**:
|
|
447
|
+
- `action` (enum, optional, default: "get"): 操作类型
|
|
448
|
+
- `get` — 查看当前配置
|
|
449
|
+
- `set` — 设置配置
|
|
450
|
+
- `clear` — 清除配置
|
|
451
|
+
- `baseUrl` (string, optional): CODING 基础地址,如 http://e-kjr1wok.coding.smartcitysz.work(set 时生效)
|
|
452
|
+
- `projectId` (string, optional): 默认项目 ID(set 时生效)
|
|
453
|
+
- `account` (string, optional): 默认账号(邮箱)(set 时生效)
|
|
454
|
+
- `cookies` (string, optional): 浏览器 Cookie 字符串(set 时生效,敏感信息)
|
|
455
|
+
- `password` (string, optional): CODING 密码(set 时生效,敏感信息)
|
|
456
|
+
|
|
457
|
+
##### Claude Code / Qoder CLI 调用示例
|
|
458
|
+
```
|
|
459
|
+
请查看 CODING 配置。
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
```
|
|
463
|
+
请设置 CODING 基础地址为 http://e-kjr1wok.coding.smartcitysz.work,项目 ID 为 123。
|
|
554
464
|
```
|
|
555
465
|
|
|
556
466
|
## 安装方式
|
|
@@ -653,9 +563,9 @@ mcp_servers:
|
|
|
653
563
|
}
|
|
654
564
|
```
|
|
655
565
|
|
|
656
|
-
**方式3d:Qwen Code Streamable HTTP 直连(推荐)**
|
|
566
|
+
**方式3d:Qoder CLI / Qwen Code Streamable HTTP 直连(推荐)**
|
|
657
567
|
|
|
658
|
-
在 `~/.
|
|
568
|
+
在 `~/.qoder/settings.json` 中配置:
|
|
659
569
|
|
|
660
570
|
```json
|
|
661
571
|
{
|
|
@@ -668,7 +578,7 @@ mcp_servers:
|
|
|
668
578
|
}
|
|
669
579
|
```
|
|
670
580
|
|
|
671
|
-
**方式3e:Qwen Code 本地直连 stdio(推荐,无需远程服务器)**
|
|
581
|
+
**方式3e:Qoder CLI / Qwen Code 本地直连 stdio(推荐,无需远程服务器)**
|
|
672
582
|
|
|
673
583
|
```json
|
|
674
584
|
{
|
|
@@ -720,6 +630,16 @@ npx szcd-mcp-proxy --test
|
|
|
720
630
|
| `MCP_TIMEOUT` | 请求超时时间(毫秒) | `30000` | `60000` |
|
|
721
631
|
| `MCP_API_KEY` | MCP API 密钥(可选) | `` | `your-secret-key` |
|
|
722
632
|
|
|
633
|
+
### CODING 配置
|
|
634
|
+
|
|
635
|
+
| 变量 | 说明 | 默认值 | 示例 |
|
|
636
|
+
|------|------|--------|------|
|
|
637
|
+
| `CODING_BASE_URL` | CODING 基础地址 | `` | `http://e-kjr1wok.coding.smartcitysz.work` |
|
|
638
|
+
| `CODING_DEFAULT_PROJECT_ID` | 默认项目 ID | `` | `123` |
|
|
639
|
+
| `CODING_ACCOUNT` | 默认账号(邮箱) | `` | `user@example.com` |
|
|
640
|
+
| `CODING_COOKIES` | 浏览器 Cookie(敏感) | `` | `session=xxx` |
|
|
641
|
+
| `CODING_PASSWORD` | CODING 密码(敏感) | `` | `your-password` |
|
|
642
|
+
|
|
723
643
|
### 视觉模型配置(设计稿分析功能必需)
|
|
724
644
|
|
|
725
645
|
| 变量 | 说明 | 默认值 | 示例 |
|
|
@@ -745,8 +665,8 @@ npx szcd-mcp-proxy --test
|
|
|
745
665
|
## 使用流程
|
|
746
666
|
|
|
747
667
|
1. **确定用户需求**:了解用户想要查询的组件信息或文件
|
|
748
|
-
2. **
|
|
749
|
-
3. **
|
|
668
|
+
2. **AI助手自动选择合适的MCP工具**:AI助手会根据需求自动识别并调用对应的MCP工具
|
|
669
|
+
3. **AI助手自动连接MCP服务器**:AI助手通过MCP协议连接到运行在MCP_SERVER_URL的服务器
|
|
750
670
|
4. **MCP服务器执行查询**:服务器接收工具调用请求,执行相应的业务逻辑
|
|
751
671
|
5. **返回结构化结果**:服务器返回JSON格式的结果,AI助手处理并呈现给用户
|
|
752
672
|
|
|
@@ -757,11 +677,12 @@ npx szcd-mcp-proxy --test
|
|
|
757
677
|
- 读取文件时,大文件可能会被截断,用户可以通过设置 maxChars 参数来调整
|
|
758
678
|
- **需要确保 MCP 服务器正在运行,否则无法查询数据**
|
|
759
679
|
- **服务器地址从环境变量或配置文件动态获取,无需硬编码**
|
|
760
|
-
- **
|
|
761
|
-
- **Qwen Code会自动处理MCP协议通信,用户无需手动调用API**
|
|
680
|
+
- **AI助手会自动处理MCP协议通信,用户无需手动调用API**
|
|
762
681
|
- **设计稿分析功能需要配置视觉模型 API Key**,未配置时 analyze_design_image 工具会返回错误
|
|
763
682
|
- **设计稿分析会调用外部多模态模型 API**,会产生额外费用(单张约 $0.03~0.05)
|
|
764
683
|
- **设计稿分析结果会自动缓存 24 小时**,同一图片重复查询不会重复计费
|
|
684
|
+
- **CODING Issue 工具需要配置 Cookie 或账号密码**,推荐使用 Cookie 模式
|
|
685
|
+
- **CODING 敏感信息(cookies、password)查看时会被脱敏显示**
|
|
765
686
|
|
|
766
687
|
## 故障排除
|
|
767
688
|
|
|
@@ -780,22 +701,29 @@ npx szcd-mcp-proxy --test
|
|
|
780
701
|
2. 检查 JSON 格式是否正确
|
|
781
702
|
3. 检查文件权限
|
|
782
703
|
|
|
704
|
+
### CODING Issue 获取失败
|
|
705
|
+
|
|
706
|
+
1. 检查 baseUrl 和 projectId 是否正确
|
|
707
|
+
2. Cookie 可能已过期,需重新从浏览器复制
|
|
708
|
+
3. 使用 coding_config 工具设置默认值,避免每次手动传参
|
|
709
|
+
|
|
783
710
|
## 示例对话
|
|
784
711
|
|
|
785
|
-
### 示例 1
|
|
712
|
+
### 示例 1:获取架构概览
|
|
786
713
|
|
|
787
|
-
**用户**:szcd
|
|
788
|
-
**助手**:让我为您查询 szcd
|
|
714
|
+
**用户**:szcd 组件库的架构是什么样的?
|
|
715
|
+
**助手**:让我为您查询 szcd 组件库的架构概览。
|
|
789
716
|
|
|
790
|
-
[助手自动触发MCP工具调用:
|
|
717
|
+
[助手自动触发MCP工具调用:get_architecture_overview()]
|
|
791
718
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
719
|
+
**助手**:szcd 组件库采用7层封装架构:
|
|
720
|
+
1. Ant Design(基础层)
|
|
721
|
+
2. Cover 层(封装层)
|
|
722
|
+
3. Wrapper 层(业务包装层)
|
|
723
|
+
4. ProPackages(高级封装层)
|
|
724
|
+
5. 复合组件层
|
|
725
|
+
6. 模板层(TreeQueryTable/QueryTabsTables等)
|
|
726
|
+
7. AI 辅助层
|
|
799
727
|
|
|
800
728
|
### 示例 2:搜索组件
|
|
801
729
|
|
|
@@ -809,71 +737,54 @@ npx szcd-mcp-proxy --test
|
|
|
809
737
|
- ProTable(ProComponents)
|
|
810
738
|
- Table(Ant Design)
|
|
811
739
|
|
|
812
|
-
### 示例 3
|
|
813
|
-
|
|
814
|
-
**用户**:Cover 层有哪些组件?
|
|
815
|
-
**助手**:让我查询 Cover 层的组件列表。
|
|
816
|
-
|
|
817
|
-
[助手自动触发MCP工具调用:list_cover_components()]
|
|
818
|
-
|
|
819
|
-
**助手**:Cover 层有以下组件:
|
|
820
|
-
- Button
|
|
821
|
-
- Input
|
|
822
|
-
- Select
|
|
823
|
-
- DatePicker
|
|
824
|
-
...
|
|
740
|
+
### 示例 3:获取组件详情
|
|
825
741
|
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
**用户**:Ant Design 的 Table 组件有哪些 Props?
|
|
829
|
-
**助手**:让我查询 Ant Design Table 组件的详细信息。
|
|
830
|
-
|
|
831
|
-
[助手自动触发MCP工具调用:get_antd_component({"name": "Table"})]
|
|
742
|
+
**用户**:获取 Query 组件的详情
|
|
743
|
+
**助手**:让我使用 get_other_component 工具来获取 Query 组件的详细信息。
|
|
832
744
|
|
|
833
|
-
|
|
834
|
-
- 中文名:表格
|
|
835
|
-
- 描述:展示行列数据
|
|
836
|
-
- 主要 Props:dataSource、columns、pagination、loading...
|
|
745
|
+
[助手自动触发MCP工具调用:get_other_component({"name": "Query"})]
|
|
837
746
|
|
|
838
|
-
|
|
747
|
+
**助手**:Query 组件的详细信息如下:
|
|
748
|
+
- 实现文件:src/other/components/Query/index.tsx
|
|
749
|
+
- 导出位置:src/other/components/index.js
|
|
750
|
+
- 透传目标:Select、DatePicker、Input、ProFormText
|
|
839
751
|
|
|
840
|
-
|
|
841
|
-
**助手**:让我使用 list_other_components 工具来查询项目中的复合组件。
|
|
752
|
+
### 示例 4:查询组件依赖
|
|
842
753
|
|
|
843
|
-
|
|
754
|
+
**用户**:TemplateMode 组件依赖了哪些 szcd 组件?
|
|
755
|
+
**助手**:让我查询 TemplateMode 的依赖关系。
|
|
844
756
|
|
|
845
|
-
|
|
846
|
-
- Query
|
|
847
|
-
- TableOrList
|
|
848
|
-
- TitleAndBack
|
|
849
|
-
- LeftTree
|
|
757
|
+
[助手自动触发MCP工具调用:get_component_dependencies({"name": "TemplateMode", "direction": "depends-on"})]
|
|
850
758
|
|
|
851
|
-
|
|
759
|
+
**助手**:TemplateMode 依赖以下 szcd 组件:
|
|
760
|
+
- LeftTree(左侧树)
|
|
761
|
+
- TableOrList(表格/列表)
|
|
762
|
+
- Query(查询组件)
|
|
763
|
+
- ProCard(布局卡片)
|
|
852
764
|
|
|
853
|
-
### 示例
|
|
765
|
+
### 示例 5:获取 CODING Issue
|
|
854
766
|
|
|
855
|
-
|
|
856
|
-
|
|
767
|
+
**用户**:请获取 CODING Issue 6249 的详情
|
|
768
|
+
**助手**:让我获取 CODING Issue 6249 的详细信息。
|
|
857
769
|
|
|
858
|
-
[助手自动触发MCP工具调用:
|
|
770
|
+
[助手自动触发MCP工具调用:coding_fetch_issue({"issueCode": "6249"})]
|
|
859
771
|
|
|
860
|
-
**助手**:
|
|
861
|
-
-
|
|
862
|
-
-
|
|
863
|
-
-
|
|
772
|
+
**助手**:Issue 6249 详情:
|
|
773
|
+
- 标题:xxx
|
|
774
|
+
- 类型:缺陷/需求
|
|
775
|
+
- 优先级:高
|
|
776
|
+
- 描述:...
|
|
864
777
|
|
|
865
|
-
### 示例
|
|
778
|
+
### 示例 6:Swagger 联调
|
|
866
779
|
|
|
867
|
-
|
|
868
|
-
|
|
780
|
+
**用户**:请拉取 Swagger API 列表,地址是 http://172.31.7.103:31689/dp-label/swagger-ui.html
|
|
781
|
+
**助手**:让我获取该 Swagger 地址的所有 API。
|
|
869
782
|
|
|
870
|
-
[助手自动触发MCP工具调用:
|
|
783
|
+
[助手自动触发MCP工具调用:swagger_fetch_apis({"swaggerUrl": "http://172.31.7.103:31689/dp-label/swagger-ui.html"})]
|
|
871
784
|
|
|
872
|
-
|
|
873
|
-
1. 文件:src/anyMd/TableOrList.json - 包含组件配置信息
|
|
874
|
-
2. 文件:src/anyMd/TableOrList.txt - 包含组件描述信息
|
|
785
|
+
**助手**:共获取到 xx 个 API 分组,yy 个接口...
|
|
875
786
|
|
|
876
|
-
### 示例
|
|
787
|
+
### 示例 7:读取文件内容
|
|
877
788
|
|
|
878
789
|
**用户**:查看 Query 组件的实现代码
|
|
879
790
|
**助手**:让我使用 read_file 工具来读取 Query 组件的实现文件。
|
|
@@ -885,13 +796,32 @@ npx szcd-mcp-proxy --test
|
|
|
885
796
|
// 这里显示 src/other/components/Query/index.tsx 的内容
|
|
886
797
|
```
|
|
887
798
|
|
|
888
|
-
|
|
799
|
+
### 示例 8:分析设计稿
|
|
800
|
+
|
|
801
|
+
**用户**:请分析 docs/designs/user-list.png 这张设计稿
|
|
802
|
+
**助手**:让我使用 analyze_design_image 工具来分析这张设计稿。
|
|
803
|
+
|
|
804
|
+
[助手自动触发MCP工具调用:analyze_design_image({"imageSource": "docs/designs/user-list.png", "analysisType": "full", "targetLibrary": "szcd"})]
|
|
805
|
+
|
|
806
|
+
**助手**:设计稿分析结果如下:
|
|
807
|
+
- 页面类型:列表页(带左侧树形导航)
|
|
808
|
+
- 推荐组件:Query + LeftTree + TableOrList
|
|
809
|
+
- 样式Token差异:...
|
|
810
|
+
- CSS覆盖建议:...
|
|
811
|
+
|
|
812
|
+
## AI助手与MCP服务交互详解
|
|
813
|
+
|
|
814
|
+
### 调用机制
|
|
815
|
+
|
|
816
|
+
AI助手通过 MCP 协议(Streamable HTTP 或 stdio)连接到 MCP 服务器。AI助手会根据用户自然语言请求自动识别并调用适当的MCP工具。
|
|
817
|
+
|
|
818
|
+
### 调用流程
|
|
889
819
|
|
|
890
|
-
当用户提出需求时,
|
|
820
|
+
当用户提出需求时,AI助手会:
|
|
891
821
|
|
|
892
822
|
1. **理解用户意图**:分析用户想要获取的信息类型
|
|
893
|
-
2. **选择适当工具**:从MCP服务器提供的工具中选择最合适的
|
|
823
|
+
2. **选择适当工具**:从 MCP 服务器提供的工具中选择最合适的
|
|
894
824
|
3. **构建参数**:根据用户输入构建工具调用所需的参数
|
|
895
|
-
4. **发起MCP调用**:通过MCP协议发送工具调用请求到服务器
|
|
896
|
-
5. **处理响应**:接收服务器返回的JSON格式结果
|
|
897
|
-
6. **格式化输出**:将结果以易读的方式呈现给用户
|
|
825
|
+
4. **发起 MCP 调用**:通过 MCP 协议发送工具调用请求到服务器
|
|
826
|
+
5. **处理响应**:接收服务器返回的 JSON 格式结果
|
|
827
|
+
6. **格式化输出**:将结果以易读的方式呈现给用户
|