exploria-ui-mcp-server 2.2.7 → 2.2.9
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
CHANGED
|
@@ -39,7 +39,7 @@ MCP Server 在项目架构中扮演着核心角色,作为 AI IDE 与 Exploria
|
|
|
39
39
|
|
|
40
40
|
| 组件名称 | 功能描述 |
|
|
41
41
|
| ------------------------ | ----------------------------------------------------------------------- |
|
|
42
|
-
| **
|
|
42
|
+
| **index.ts** | 入口文件,负责初始化服务、建立与 AI IDE 的连接、注册工具/资源/提示模块 |
|
|
43
43
|
| **McpServer** | 来自 @modelcontextprotocol/sdk 的核心 MCP 服务器实例,处理 MCP 协议通信 |
|
|
44
44
|
| **StdioServerTransport** | 标准输入输出传输层,用于与 AI IDE 通信 |
|
|
45
45
|
| **DocumentParser** | 文档解析器,负责解析和处理 Exploria UI 文档 |
|
|
@@ -237,7 +237,7 @@ vector[secondaryIndex] -= weight * 0.5
|
|
|
237
237
|
│ │ (标准输入输出管道) │
|
|
238
238
|
│ ▼ │
|
|
239
239
|
│ ┌─────────────────────────────────────────────────────┐ │
|
|
240
|
-
│ │
|
|
240
|
+
│ │ index.ts (入口模块) │ │
|
|
241
241
|
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
|
|
242
242
|
│ │ │ Tools │ │ Resources │ │ Prompts │ │ │
|
|
243
243
|
│ │ │ (工具注册) │ │ (资源注册) │ │ (提示注册) │ │ │
|
|
@@ -263,7 +263,7 @@ vector[secondaryIndex] -= weight * 0.5
|
|
|
263
263
|
|
|
264
264
|
| 组件 | 职责 | 关键方法/属性 |
|
|
265
265
|
| ------------------------ | ------------------------ | --------------------------------------------- |
|
|
266
|
-
| **
|
|
266
|
+
| **index.ts** | 入口模块,启动服务、管理连接 | `startServer()`, `setupEventHandlers()` |
|
|
267
267
|
| **McpServer** | MCP SDK 核心实例 | 处理协议通信、注册工具/资源/提示 |
|
|
268
268
|
| **StdioServerTransport** | 标准输入输出传输层 | 建立与 IDE 的管道连接 |
|
|
269
269
|
| **KnowledgeService** | 向量数据库服务 | `searchKnowledge()`, `getComponentDetails()` |
|
|
@@ -461,12 +461,13 @@ MCP Server 与 AI IDE 之间支持三种传输协议:
|
|
|
461
461
|
|
|
462
462
|
1. AI 相关 IDE 通过 MCP 协议连接并请求启动 MCP Server
|
|
463
463
|
2. IDE 实际调用的是 NPM 包中 package.json 定义的可执行命令
|
|
464
|
-
3. 可执行命令指向 `dist/index.js`
|
|
465
|
-
4.
|
|
464
|
+
3. 可执行命令指向 `dist/index.js` 文件,该文件直接调用 `startServer()` 函数启动服务
|
|
465
|
+
4. 服务启动流程:
|
|
466
466
|
- 加载 package.json 获取配置信息
|
|
467
|
-
-
|
|
468
|
-
-
|
|
467
|
+
- 初始化知识索引(加载预构建向量数据库)
|
|
468
|
+
- 创建 McpServer 实例
|
|
469
469
|
- 注册所有工具、资源和提示模块
|
|
470
|
+
- 设置事件处理器(错误处理、信号处理等)
|
|
470
471
|
- 创建并连接 StdioServerTransport
|
|
471
472
|
5. 连接建立后,服务器通过 MCP 协议与 IDE 进行通信,提供各项功能
|
|
472
473
|
|