@tencentcloud/sdk-mcp 1.7.5 → 1.7.7

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +61 -53
  3. package/index.js +23 -1
  4. package/knowledge/chunker.js +1 -0
  5. package/knowledge/path-meta.js +12 -1
  6. package/knowledge/search/search-core.js +22 -4
  7. package/knowledge/search/search-knowledge.js +1 -1
  8. package/package.json +1 -1
  9. package/resource/index/manifest.json +1 -1
  10. package/resource/integration/callkit/preset/android/integration.md +0 -4
  11. package/resource/integration/callkit/preset/flutter/integration.md +0 -4
  12. package/resource/integration/callkit/preset/ios/integration.md +0 -4
  13. package/resource/integration/chat/preset/react/integration.md +0 -5
  14. package/resource/integration/chat/preset/uni-app/integration.md +0 -4
  15. package/resource/integration/chat/preset/vue/integration.md +0 -5
  16. package/resource/integration/livekit/preset/live/android/live-host-integration.md +0 -4
  17. package/resource/integration/livekit/preset/live/ios/live-host-integration.md +0 -4
  18. package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +0 -4
  19. package/resource/knowledge/callkit/preset/harmonyos/integration.md +0 -4
  20. package/resource/knowledge/chat/preset/android-view/integration.md +0 -4
  21. package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -4
  22. package/resource/knowledge/chat/preset/react/h5/integration.md +0 -5
  23. package/resource/knowledge/chat/preset/vue/h5/integration.md +0 -5
  24. package/resource/knowledge/roomkit/preset/android/integration.md +0 -4
  25. package/resource/knowledge/roomkit/preset/flutter/integration.md +0 -4
  26. package/resource/knowledge/roomkit/preset/harmonyos/integration.md +0 -4
  27. package/resource/knowledge/roomkit/preset/ios/integration.md +0 -4
  28. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +0 -4
  29. package/server-config.js +21 -6
  30. package/server.js +42 -34
  31. package/tools/common/get_usersig.js +1 -1
  32. package/tools/common/present_framework_choice.js +5 -5
  33. package/tools/definitions/finalize_answer_def.js +17 -16
  34. package/tools/definitions/get_native_call_uikit_integration_def.js +25 -16
  35. package/tools/definitions/get_native_callkit_core_integration_def.js +37 -26
  36. package/tools/definitions/get_native_chat_uikit_integration_def.js +22 -13
  37. package/tools/definitions/get_native_live_uikit_integration_def.js +30 -21
  38. package/tools/definitions/get_native_livekit_core_integration_def.js +25 -16
  39. package/tools/definitions/get_usersig_def.js +20 -13
  40. package/tools/definitions/get_web_call_uikit_integration_def.js +21 -12
  41. package/tools/definitions/get_web_chat_uikit_integration_def.js +22 -13
  42. package/tools/definitions/get_web_live_uikit_integration_def.js +21 -12
  43. package/tools/definitions/get_web_room_core_integration_def.js +29 -20
  44. package/tools/definitions/get_web_room_uikit_integration_def.js +21 -12
  45. package/tools/definitions/integration-boundary.js +9 -5
  46. package/tools/definitions/present_framework_choice_def.js +21 -21
  47. package/tools/definitions/search_trtc_knowledge_def.js +48 -26
  48. package/tools/definitions/submit_feedback_def.js +18 -14
  49. package/utils/normalize-error.js +13 -0
  50. package/utils/report-cls-client.js +2 -2
  51. package/utils/report-es-client.js +1 -1
@@ -253,10 +253,6 @@ TUICallKit.createInstance(this).calls(userIdList, mediaType, params, new Complet
253
253
 
254
254
  接听端完成登录后,拨打端发起通话,接收端就可以收到通话邀请,同时伴随铃声和振动。
255
255
 
256
- ## AI 助手:知识咨询与代码集成
257
-
258
- 您在接入视频通话 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 CallKit 组件和无 UI SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
259
-
260
256
  ## 更多功能
261
257
 
262
258
  ### AI 转录与翻译
@@ -205,10 +205,6 @@ void _call() {
205
205
 
206
206
  接听端完成登录后,拨打端发起通话,接听端就可以收到通话邀请,同时伴随铃声和振动。
207
207
 
208
- ## AI 助手:知识咨询与代码集成
209
-
210
- 您在接入视频通话 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 CallKit 组件和无 UI SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
211
-
212
208
  ## 更多功能
213
209
 
214
210
  ### AI 转录与翻译
@@ -200,10 +200,6 @@ TUICallKit.createInstance().calls(userIdList: ["mike"], mediaType: .audio, param
200
200
 
201
201
  接听端完成登录后,拨打端发起通话,接听端就可以收到通话邀请,同时伴随铃声和振动。
202
202
 
203
- ## AI 助手:知识咨询与代码集成
204
-
205
- 您在接入视频通话 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 CallKit 组件和无 UI SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
206
-
207
203
  ## 更多功能
208
204
 
209
205
  ### AI 转录与翻译
@@ -1,10 +1,5 @@
1
1
  TUIKit 是基于腾讯云 Chat SDK 的一款 React 组件库,它提供了一些通用的 UI 组件,包含会话、聊天、群组等功能。本文介绍如何快速集成 TUIKit 并实现核心功能。
2
2
 
3
- > **AI 助手使用说明:**
4
- >
5
- > MCP 提供了 **IM 知识咨询**和**含 UI 集成**的 AI 解决方案,您可以通过 MCP 查询 IM 相关的知识和集成 UIKit,[点击这里,立即体验 AI 助手](https://cloud.tencent.com/document/product/269/126983)。
6
- >
7
-
8
3
  ## 关键概念
9
4
 
10
5
  chat-uikit-react 主要分为 ConversationList、Chat、MessageList、ChatHeader、MessageInput、ChatSetting、Search、Contact 等核心 UI 组件,每个 UI 组件负责展示不同的内容。
@@ -472,10 +472,6 @@ import { initCallService } from '@/uni_modules/tuikit-atomic-x/server/callServic
472
472
  initCallService();
473
473
  ```
474
474
 
475
- ## AI 助手:知识咨询与代码集成
476
-
477
- 在接入 IM SDK 过程中,您可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和 UIKit 集成代码生成。支持 Web/Android/iOS/Flutter/uni-app 等平台,答案基于官方文档。适用于查询 SDK API、UI 组件用法、服务端 API 与 IM 产品配置等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/269/126983)。
478
-
479
475
  ## 常见问题
480
476
 
481
477
  ### 技术兼容性类
@@ -1,10 +1,5 @@
1
1
  TUIKit 是基于腾讯云 Chat SDK 的一款 Vue 3 UI 组件库,它提供了一些通用的 UI 组件,包含会话、聊天、群组等功能。本文介绍如何快速集成 TUIKit 并实现核心功能。
2
2
 
3
- > **说明:**
4
- > - **AI 助手使用说明**
5
- > MCP 提供了 **IM 知识咨询**和**含 UI 集成**的 AI 解决方案,您可以通过 MCP 查询 IM 相关的知识和集成 UIKit,[点击这里,立即体验 AI 助手](https://cloud.tencent.com/document/product/269/126983)。
6
- >
7
-
8
3
  |接入需求|桌面端|移动端 H5|
9
4
  |---------|---------|---------|
10
5
  |全新 Web Vue3 项目|
@@ -142,10 +142,6 @@ class AnchorActivity : AppCompatActivity() {
142
142
  }
143
143
  ```
144
144
 
145
- ## AI 助手:知识咨询与代码集成
146
-
147
- 您在接入直播与语聊 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 AtomicXCore SDK 和 UI 组件用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
148
-
149
145
  ## 自定义您的界面布局
150
146
 
151
147
  `TUILiveKit` 支持灵活定制开播页与直播页的功能和样式,您可根据业务需求调整布局、隐藏 / 显示功能模块。
@@ -263,10 +263,6 @@ extension YourAnchorPrepareViewController : AnchorPrepareViewDelegate {
263
263
 
264
264
  ###
265
265
 
266
- ## AI 助手:知识咨询与代码集成
267
-
268
- 您在接入直播与语聊 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 AtomicXCore SDK 和 UI 组件用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
269
-
270
266
  ## 自定义您的界面布局
271
267
 
272
268
  `TUILiveKit` 支持灵活定制开播页与直播页的功能和样式,您可根据业务需求调整布局、隐藏 / 显示功能模块。
@@ -142,10 +142,6 @@ npm run dev
142
142
  > 观看请使用与开播端不同的用户 ID,否则先登录的设备会被强制下线。
143
143
  >
144
144
 
145
- ## AI 助手:知识咨询与代码集成
146
-
147
- 您在接入直播与语聊 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 AtomicXCore SDK、UI 组件用法、集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
148
-
149
145
  ## 功能模块
150
146
 
151
147
  以下模块均为可独立复制的组件,需要先通过 集成主播开播页面,然后根据您的业务需求将下列各个模块的代码直接粘贴进对应的注释部分去即可。
@@ -225,10 +225,6 @@ try {
225
225
 
226
226
  接听端完成登录后,拨打端发起通话,接收端就可以收到通话邀请,同时伴随铃声和振动。
227
227
 
228
- ## AI 助手:知识咨询与代码集成
229
-
230
- 您在接入视频通话 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 CallKit 组件和无 UI SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
231
-
232
228
  ## 更多功能
233
229
 
234
230
  ### 开启来电横幅
@@ -252,10 +252,6 @@ TencentAiDeskCustomer.getInstance().initWithProfile(context, SDKAppID, userID, u
252
252
  });
253
253
  ```
254
254
 
255
- ## AI 助手:知识咨询与代码集成
256
-
257
- 在接入 IM SDK 过程中,您可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和 UIKit 集成代码生成。支持 Web/Android/iOS/Flutter/uni-app 等平台,答案基于官方文档。适用于查询 SDK API、UI 组件用法、服务端 API 与 IM 产品配置等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/269/126983)。
258
-
259
255
  ## 常见问题
260
256
 
261
257
  ### 音视频常见问题
@@ -269,10 +269,6 @@ func showChat(_ info: ConversationInfo) {
269
269
  }
270
270
  ```
271
271
 
272
- ## AI 助手:知识咨询与代码集成
273
-
274
- 在接入 IM SDK 过程中,您可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和 UIKit 集成代码生成。支持 Web/Android/iOS/Flutter/uni-app 等平台,答案基于官方文档。适用于查询 SDK API、UI 组件用法、服务端 API 与 IM 产品配置等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/269/126983)。
275
-
276
272
  ## 常见问题
277
273
 
278
274
  ### 音视频常见问题
@@ -1,10 +1,5 @@
1
1
  TUIKit 是基于腾讯云 Chat SDK 的一款 React 组件库,它提供了一些通用的 UI 组件,包含会话、聊天、群组等功能。本文介绍如何快速集成 TUIKit 并实现核心功能。
2
2
 
3
- > **AI 助手使用说明:**
4
- >
5
- > MCP 提供了 **IM 知识咨询**和**含 UI 集成**的 AI 解决方案,您可以通过 MCP 查询 IM 相关的知识和集成 UIKit,[点击这里,立即体验 AI 助手](https://cloud.tencent.com/document/product/269/126983)。
6
- >
7
-
8
3
  ## 关键概念
9
4
 
10
5
  chat-uikit-react 主要分为 ConversationListH5、MessageListH5、ChatHeaderH5、MessageInputH5、ChatSettingH5、SearchH5、ContactH5 等核心 UI 组件,每个 UI 组件负责展示不同的内容。
@@ -1,10 +1,5 @@
1
1
  TUIKit 是基于腾讯云 Chat SDK 的一款 Vue 3 UI 组件库,它提供了一些通用的 UI 组件,包含会话、聊天、群组等功能。本文介绍如何快速集成 TUIKit 并实现核心功能。
2
2
 
3
- > **说明:**
4
- > - **AI 助手使用说明**
5
- > MCP 提供了 **IM 知识咨询**和**含 UI 集成**的 AI 解决方案,您可以通过 MCP 查询 IM 相关的知识和集成 UIKit,[点击这里,立即体验 AI 助手](https://cloud.tencent.com/document/product/269/126983)。
6
- >
7
-
8
3
  |接入需求|桌面端|移动端 H5|
9
4
  |---------|---------|---------|
10
5
  |全新 Web Vue3 项目|全功能接入 > 移动端 > Vue3|
@@ -309,10 +309,6 @@ class MainActivity : AppCompatActivity() {
309
309
 
310
310
  **参数详细说明。
311
311
 
312
- ## AI 助手:知识咨询与代码集成
313
-
314
- 您在接入视频会议 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 Room 组件和 AtomicXCore SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
315
-
316
312
  ## 核心功能
317
313
 
318
314
  接入 `RoomMainView` 代码后,开发者将得到一个完整的多人音视频页面,内部包含成员管理,音视频设备控制,房间信息展示等功能,这是 `TUIRoomKit` 组件的核心。
@@ -302,10 +302,6 @@ class YourMainPage extends StatelessWidget {
302
302
  > 使用 TUIRoomKit 组件进入大型研讨会房间时,需确保 Web 端创建的研讨会房间的房间 ID 以 `webinar_` 开头。
303
303
  >
304
304
 
305
- ## AI 助手:知识咨询与代码集成
306
-
307
- 您在接入视频会议 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 Room 组件和 AtomicXCore SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
308
-
309
305
  ## 核心功能
310
306
 
311
307
  接入 `RoomMainWidget` 代码后,开发者将得到一个完整的多人音视频页面,内部包含成员管理,音视频设备控制,房间信息展示等功能,这是 `TUIRoomKit` 组件的核心。
@@ -413,10 +413,6 @@ struct RoomMainDestination {
413
413
  > 使用 TUIRoomKit 组件进入大型研讨会房间时,需确保 Web 端创建的研讨会房间的房间 ID 以 `webinar_` 开头。
414
414
  >
415
415
 
416
- ## AI 助手:知识咨询与代码集成
417
-
418
- 您在接入视频会议 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 Room 组件和 AtomicXCore SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
419
-
420
416
  ## 核心功能
421
417
 
422
418
  接入 `RoomMainPage` 代码后,开发者将得到一个完整的多人音视频页面,内部包含成员管理,音视频设备控制,房间信息展示等功能,这是 `TUIRoomKit` 组件的核心。
@@ -270,10 +270,6 @@ class YourMainViewController: UIViewController, RouterContext {
270
270
 
271
271
  **参数详细说明请参考:**[RoomMainView 构造函数参数详细说明]( 构造函数参数详细说明) 和 [ConnectConfig 参数详细说明]( 参数详细说明)
272
272
 
273
- ## AI 助手:知识咨询与代码集成
274
-
275
- 您在接入视频会议 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 Room 组件和 AtomicXCore SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
276
-
277
273
  ## 核心功能
278
274
 
279
275
  接入 `RoomMainView` 代码后,开发者将得到一个完整的多人音视频页面,内部包含成员管理,音视频设备控制,房间信息展示等功能,这是 `TUIRoomKit` 组件的核心。
@@ -213,10 +213,6 @@ login({
213
213
 
214
214
  点击**运行** > **运行到手机或模拟器** > **运行到 Android/iOS 基座**,使用制作好的**自定义基座**运行到手机。
215
215
 
216
- ## AI 助手:知识咨询与代码集成
217
-
218
- 您在接入视频会议 SDK 过程中,可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和集成代码生成。支持 Web/Android/iOS/Flutter/uni-app/HarmonyOS 等平台,答案基于官方文档。适用于查询 Room 组件和 AtomicXCore SDK 用法以及集成文档等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/647/129285)。
219
-
220
216
  ## 高级功能
221
217
 
222
218
  ### 屏幕共享
package/server-config.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { reportESClient } from './utils/report-es-client.js';
2
+ import { reportCLSClient } from './utils/report-cls-client.js';
2
3
  import { isValidSDKAppID } from './utils/is-valid-sdkappid.js';
3
4
  import { getDeviceIdentifier } from './utils/get-device-identifier.js';
4
5
  class ServerConfig {
@@ -16,17 +17,31 @@ class ServerConfig {
16
17
  parseEnvConfig() {
17
18
  const config = {};
18
19
  const { SDKAPPID, SECRETKEY } = process.env || {};
19
- if (SDKAPPID) {
20
+ if (SDKAPPID && isValidSDKAppID(SDKAPPID)) {
20
21
  config.SDKAppID = SDKAPPID;
21
22
  }
22
- const sdkappid = isValidSDKAppID(SDKAPPID) ? SDKAPPID : `${getDeviceIdentifier()}:zh`;
23
- reportESClient({
24
- SDKAppID: sdkappid,
25
- method: 'mcp_config'
26
- });
23
+ else {
24
+ config.SDKAppID = `${getDeviceIdentifier()}:zh`;
25
+ }
27
26
  if (SECRETKEY) {
28
27
  config.secretKey = SECRETKEY;
29
28
  }
29
+ try {
30
+ reportESClient({
31
+ SDKAppID: config.SDKAppID,
32
+ method: 'mcp_config'
33
+ });
34
+ reportCLSClient({
35
+ SDKAppID: config.SDKAppID,
36
+ method: 'mcp_server_config',
37
+ from: 'stdio',
38
+ info: JSON.stringify({
39
+ status: 'success',
40
+ }),
41
+ });
42
+ }
43
+ catch (error) { }
44
+ ;
30
45
  return config;
31
46
  }
32
47
  getConfig() {
package/server.js CHANGED
@@ -1,47 +1,55 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { registryTools } from './tools/index.js';
3
3
  const SERVER_INSTRUCTIONS = `
4
- You are using Tencent RTC MCP Server for SDK documentation retrieval.
5
-
6
- - search_trtc_knowledge: Primary tool for searching Tencent RTC / Chat(IM) / Push(TIMPush) product documentation.
7
- Covers: Chat UIKit, CallKit, LiveKit, RoomKit, TRTC Native SDK, WebRTC/rtcEngine, TIMPush.
8
- Use this tool FIRST for all technical documentation / FAQ / error code / integration guide lookups.
9
- Do NOT use web_search for questions that can be answered via this knowledge base.
10
-
11
- **Product routing(调用 search_trtc_knowledge 前 MUST 推断 product 数组)**:
12
- - TIMPush / 推送 / 厂商通道 / FCM / APNs / 华为 / 小米 / OPPO / vivo → product=["push"](独立产品,禁止误归 chat)
13
- - 会话 / TUIKit / ChatKit / IM 组件 / 主题定制 → ["chat"]
14
- - CallKit / 通话 → ["call"];直播 / 语聊房 / LiveKit → ["live"];RoomKit / 会议 → ["room"]
15
- - TRTC Web SDK / rtcengine / WebRTC 插件 → ["rtcengine"]
16
- - TRTCCloud / Native SDK(客户端)→ ["native_trtc_sdk"]
17
- - 推送 + IM 同时涉及 → 可传 ["push","chat"]
18
- - 无法从 prompt 唯一判断 product → 先向用户确认,不要无 product 硬搜,也不要 web_search
19
-
20
- **Frameworks**:返回 needs_framework 时 MUST 先 present_framework_choice;详见 search_trtc_knowledge 工具 description 决策表。
21
- **When in doubt**:仍优先调用 search_trtc_knowledge(带最佳猜测 product);status=empty 或 low_confidence 时再澄清或重搜。
22
-
23
- **queryID 传递规则(硬规则,违反会导致 CLS 数据断裂)**:
24
- - 首次调用 search_trtc_knowledge:无需传 queryID(默认空串),响应 JSON 中会有 server 生成的 queryID 字段
25
- - 后续每一次 search_trtc_knowledge / finalize_answer / submit_feedback 调用:**MUST** 携带首次响应中的 queryID
26
- - 不传 queryID = 视为全新咨询(CLS 数据无法串联)
27
- - 多 sub-question 迭代搜索时,每次都要带相同的 queryID
28
-
29
- Workflow:
30
- 1. Call search_trtc_knowledge. Reuse the same queryID for all retries/searches in this consultation.
31
- 2. Draft the complete answer from fragments. Include References from meta.references/doc_urls when available.
4
+ You are using Tencent RTC MCP Server for official SDK and product documentation retrieval.
5
+
6
+ Primary routing policy:
7
+ - For Tencent RTC technical Q&A, troubleshooting, API/component lookup, and integration documentation lookup, call search_trtc_knowledge first.
8
+ - Do NOT use web_search when this knowledge base can answer the question.
9
+ - get_*_integration tools are for explicit codegen/integration implementation only (for example: user asks to generate or modify runnable integration code).
10
+
11
+ Scope for search_trtc_knowledge:
12
+ - Chat (IM), Call, Live, Room, Push (TIMPush), Web TRTC (rtcengine), Native TRTC SDK.
13
+ - Applies to FAQ, error codes, APIs, SDK usage, component usage, integration references, and troubleshooting.
14
+
15
+ Product routing (infer product array before calling search_trtc_knowledge whenever possible):
16
+ - TIMPush / 推送 / 厂商通道 / FCM / APNs / 华为 / 小米 / OPPO / vivo -> ["push"]
17
+ - 会话 / TUIKit / ChatKit / IM 组件 / 主题定制 -> ["chat"]
18
+ - CallKit / 通话 -> ["call"]; 直播 / 语聊房 / LiveKit -> ["live"]; RoomKit / 会议 -> ["room"]
19
+ - TRTC Web SDK / rtcengine / WebRTC 插件 -> ["rtcengine"]
20
+ - TRTCCloud / Native SDK / 客户端 -> ["native_trtc_sdk"]
21
+ - If both push and IM are involved -> ["push", "chat"]
22
+ - If product cannot be inferred confidently, ask a brief clarification. Do not jump to web_search.
23
+
24
+ Framework policy:
25
+ - If search_trtc_knowledge returns needs_framework, call present_framework_choice first, then search again.
26
+ - See search_trtc_knowledge description for detailed framework decision rules.
27
+
28
+ queryID propagation rules (hard requirement):
29
+ - First search_trtc_knowledge call: queryID can be empty; server response includes generated queryID.
30
+ - Every subsequent search_trtc_knowledge / finalize_answer / submit_feedback call: MUST include that same queryID.
31
+ - Missing queryID is treated as a new consultation and breaks CLS linkage.
32
+ - For multi-subquestion iterative search, always reuse the same queryID.
33
+
34
+ Consultation workflow (search_trtc_knowledge flow only):
35
+ 1. Call search_trtc_knowledge and reuse the same queryID for all retries/searches in this consultation.
36
+ 2. Draft the final answer from fragments. Include references from meta.references/doc_urls when available.
32
37
  3. MUST call finalize_answer with the same prompt, answer, and queryID before replying.
33
- 4. Reply with that answer + finalize_answer follow-up text.
34
- 5. After finalize_answer follow-up, check the next user reply before any normal response. If it means Yes/已解决/thanks/OK, MUST call submit_feedback(resolved="1") before replying. If it means No/未解决/still not working, MUST call submit_feedback(resolved="0") before replying. Never say feedback was submitted unless submit_feedback was called.
38
+ 4. Reply with that answer plus finalize_answer follow-up text.
39
+ 5. After follow-up, inspect the next user reply before any normal response. If it means Yes/已解决/thanks/OK, MUST call submit_feedback(resolved="1") before replying. If it means No/未解决/still not working, MUST call submit_feedback(resolved="0") before replying. Never claim feedback is submitted unless submit_feedback was actually called.
40
+
41
+ Codegen workflow note:
42
+ - For get_*_integration codegen flow, do NOT call finalize_answer or submit_feedback.
35
43
 
36
44
  User-visible output rule (MUST):
37
- - Internal routing/tool decisions are NEVER user-facing text.
38
- - Before calling any tool, do NOT output preface like “应调用…/先调用…/让我先搜索…/属于咨询类问题…/而非 codegen…”.
39
- - If a tool call is needed, call it directly; then provide user-facing results only.
45
+ - Internal routing or tool-decision details are NEVER user-facing text.
46
+ - Before any tool call, do NOT output prefaces like “应调用… / 先调用… / 让我先搜索… / 属于咨询类问题… / 而非 codegen…”.
47
+ - If a tool call is needed, call it directly and then provide only user-facing results.
40
48
  `.trim();
41
49
  export function createServer() {
42
50
  const server = new McpServer({
43
51
  name: "Tencent RTC MCP Server",
44
- version: "1.7.5",
52
+ version: "1.7.7",
45
53
  }, {
46
54
  instructions: SERVER_INSTRUCTIONS,
47
55
  });
@@ -21,7 +21,7 @@ const registryGetUserSigTool = (mcpServer) => {
21
21
  text: JSON.stringify({
22
22
  error: 'CONFIG_MISSING',
23
23
  message: 'Failed to generate userSig. Reason: SDKAppID or secretKey was not configured via MCP environment variables.',
24
- guide: 'Please guide the user to configure SDKAppID and secretKey according to the tool description (Constraints 2, 3, and 4), specifically by obtaining them from the IM or TRTC Console.'
24
+ guide: 'Please guide the user to configure SDKAppID and secretKey in MCP environment variables, usually obtained from the IM or TRTC Console.'
25
25
  }),
26
26
  }
27
27
  ]
@@ -38,14 +38,14 @@ function buildSelectionText(product, selectionText) {
38
38
  const options = config.options.map((option) => `- '${option}'`).join('\n');
39
39
  return `${selectionText}
40
40
 
41
- 请先让用户选择以下平台或框架:
41
+ Please ask user to choose one platform/framework from the list below:
42
42
 
43
- ${config.title}:
43
+ ${config.title}:
44
44
  ${options}
45
45
 
46
- 请等待用户回复具体平台后(**硬规则,不可跳过**):
47
- - **咨询 / 查文档 / API / 组件 / feature** → MUST 调用 \`search_trtc_knowledge\`,传入 **product + frameworks**
48
- - **要写代码集成进项目** → MUST 调用对应的 \`get_*_integration\` 工具`;
46
+ After user selects a concrete platform (hard rule, do not skip):
47
+ - **Q&A / documentation lookup / API / component / feature** -> MUST call \`search_trtc_knowledge\` with **product + frameworks**
48
+ - **Explicit codegen or project integration implementation** -> MUST call corresponding \`get_*_integration\` tool`;
49
49
  }
50
50
  const registryPresentFrameworkChoiceTool = (mcpServer) => {
51
51
  const { name, description, selectionText, parameter_descriptions } = PRESENT_FRAMEWORK_CHOICE_DEFINITION;
@@ -1,27 +1,28 @@
1
1
  export const FOLLOWUP_QUESTION = '以上是否解决了您的问题?请回复「已解决」或「未解决」,方便我们进一步优化回答质量。';
2
2
  const TOOL_DESCRIPTION = `
3
3
  Purpose:
4
- Finalize a search_trtc_knowledge answer and return the follow-up text to append.
4
+ Finalize the answer in current consultation and return the follow-up text.
5
5
 
6
- When to call:
7
- - After all searches/fetches are done and the final answer is drafted, MUST call this tool exactly once before replying to the user.
8
- - Do NOT call it for intermediate searches, partial drafts, or when another search/fetch is still needed.
6
+ When to call (hard rule):
7
+ - Call exactly once after all searches are done and final answer is ready.
8
+ - MUST be called before replying final answer to user.
9
+ - Do NOT call for drafts, intermediate reasoning, or unfinished retrieval.
9
10
 
10
- Input:
11
- - prompt: Original user question. Must match the search_trtc_knowledge prompt.
12
- - answer: Full synthesized answer (same text sent to the user).
13
- - queryID: REQUIRED. Must match the non-empty queryID returned by search_trtc_knowledge.
14
- - product/framework: Reuse the same values from the search_trtc_knowledge chain when available.
11
+ Input contract:
12
+ - prompt: original user question, consistent with search_trtc_knowledge prompt.
13
+ - answer: final user-facing answer text.
14
+ - queryID: REQUIRED, non-empty queryID from search_trtc_knowledge.
15
+ - product/framework: reuse values from the same consultation chain when available.
15
16
 
16
- Returns:
17
- - Follow-up text. Append it as-is after the answer.
18
- - Do NOT write your own follow-up question.
17
+ Output contract:
18
+ - Return follow-up text and append it as-is after answer.
19
+ - Do NOT write custom follow-up wording.
19
20
  `;
20
21
  const PARAMETER_DESCRIPTIONS = {
21
- prompt: 'Original user question. Must match search_trtc_knowledge.',
22
- answer: 'Full synthesized answer (same text sent to the user).',
23
- product: 'Reuse product from the search_trtc_knowledge chain when available.',
24
- framework: 'Reuse framework from the search_trtc_knowledge chain when available.',
22
+ prompt: 'Original user question. Must match search_trtc_knowledge prompt.',
23
+ answer: 'Final synthesized answer, same content sent to user.',
24
+ product: 'Reuse product from current search_trtc_knowledge chain when available.',
25
+ framework: 'Reuse framework from current search_trtc_knowledge chain when available.',
25
26
  queryID: 'REQUIRED. Non-empty queryID returned by search_trtc_knowledge.',
26
27
  };
27
28
  export const FINALIZE_ANSWER_DEFINITION = {
@@ -1,32 +1,41 @@
1
1
  import { INTEGRATION_BOUNDARY_SUFFIX } from './integration-boundary.js';
2
2
  const TOOL_DESCRIPTION = `
3
- 用途:
4
- 返回 Native TUICallKit preset 集成文档,供 AI 完成移动端音视频通话接入与代码生成(预制通话界面、开箱即用)。
3
+ Purpose:
4
+ Return Native TUICallKit preset integration docs for explicit codegen implementation.
5
5
 
6
- 典型适用问题(共用触发词,可能同时命中 'get_native_callkit_core_integration' Core 工具):
6
+ When to call (MUST):
7
+ - User explicitly asks for runnable project integration code or concrete implementation steps.
8
+
9
+ When NOT to call:
10
+ - Pure feature Q&A, documentation lookup, API/component explanation, troubleshooting.
11
+
12
+ Scope details:
13
+ Returns Native TUICallKit preset integration documentation for implementing mobile audio/video calling with ready-made UI.
14
+
15
+ Common trigger lexicon (may overlap with 'get_native_callkit_core_integration' Core 工具):
7
16
  集成 CallKit, 接入 CallKit, 音视频通话, 语音通话, 视频通话, 1v1 通话, 多人通话, 通话功能, 拨打电话, 接听电话, 来电, 离线推送, VoIP
8
- 命中以上共用触发词时,请**先主动追问用户**:"您希望使用默认通话界面快速集成(TUICallKit preset),还是基于 Core SDK 自定义通话界面?" 用户选择"默认/preset"后再调用本工具;选择"自定义/Core"则调用 'get_native_callkit_core_integration'。
17
+ When only common triggers are hit, ask a clarification first: "Do you prefer preset default UI (TUICallKit) or Core SDK custom UI?" Call this tool only after user chooses preset/default; if user chooses custom/Core, call 'get_native_callkit_core_integration'.
9
18
 
10
- 典型适用问题(preset 专属触发词,仅命中本工具,无需追问,直接调用):
19
+ Preset-only trigger lexicon (direct call, no clarification needed):
11
20
  TUICallKit, Native TUICallKit, Native Call UIKit, preset, preset 集成, 预制 UI, 预制通话界面, 默认 UI, 默认通话界面, 开箱即用通话界面, 现成的通话页面, 通话界面已经有了, TUICallKit Flutter, TUICallKit Android, TUICallKit iOS
12
21
 
13
- 输入:
22
+ Inputs:
14
23
  - framework: flutter | android | ios
15
- - prompt: 用户的原始问题全文,保留完整上下文,不要压缩成关键词摘要
24
+ - prompt: Original user question. Keep full context; do not compress into keyword summary.
16
25
 
17
- 返回:
18
- - content: [{ type: 'text', text: 文档正文或说明文本 }]
26
+ Outputs:
27
+ - content: [{ type: 'text', text: Documentation body or explanatory text }]
19
28
 
20
- 边界:
21
- - 当用户未明确平台或框架时,应先调用 'present_framework_choice'
22
- - framework=uni-app 时不支持本工具(preset 无 uni-app 端),请改用 'get_native_callkit_core_integration'
23
- - 当用户已明示「自定义 UI」「Core SDK」「AtomicXCore」「CallStore」「自己画通话页面」等 Core 专属触发词时,直接调用 'get_native_callkit_core_integration',不要走本工具
24
- - 面向 Native CallKit preset 整体集成,不负责平台选择,也不负责铃声、虚拟背景、头像昵称、悬浮窗等单功能/API 设置问题
29
+ Boundaries:
30
+ - If platform/framework is not specified, call 'present_framework_choice' first.
31
+ - framework=uni-app is not supported by this preset tool (no preset uni-app support). Use 'get_native_callkit_core_integration' instead.
32
+ - If user explicitly indicates Core intent (e.g. custom UI / Core SDK / AtomicXCore / CallStore / self-built call page), call 'get_native_callkit_core_integration' directly.
33
+ - This tool targets end-to-end Native CallKit preset integration. It does not handle platform selection or isolated single-feature/API setup topics (e.g. ringtone, virtual background, avatar/nickname, floating window).
25
34
  ${INTEGRATION_BOUNDARY_SUFFIX}
26
35
  `;
27
36
  const PARAMETER_DESCRIPTIONS = {
28
- framework: '目标平台。参数名固定为 framework,禁止传 platform。可选值:flutter | android | ios。',
29
- prompt: '用户的原始问题全文,保留完整上下文,不要压缩成关键词摘要。',
37
+ framework: 'Target platform. Parameter name must be framework (not platform). Allowed values: flutter | android | ios。',
38
+ prompt: 'Original user question. Keep full context; do not compress into keyword summary.',
30
39
  };
31
40
  export const GET_NATIVE_CALL_UIKIT_INTEGRATION_DEFINITION = {
32
41
  name: 'get_native_call_uikit_integration',