@tencentcloud/sdk-mcp 1.7.5 → 1.7.6

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 (48) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +57 -54
  3. package/knowledge/chunker.js +1 -0
  4. package/knowledge/path-meta.js +12 -1
  5. package/knowledge/search/search-core.js +22 -4
  6. package/knowledge/search/search-knowledge.js +1 -1
  7. package/package.json +1 -1
  8. package/resource/index/manifest.json +1 -1
  9. package/resource/integration/callkit/preset/android/integration.md +0 -4
  10. package/resource/integration/callkit/preset/flutter/integration.md +0 -4
  11. package/resource/integration/callkit/preset/ios/integration.md +0 -4
  12. package/resource/integration/chat/preset/react/integration.md +0 -5
  13. package/resource/integration/chat/preset/uni-app/integration.md +0 -4
  14. package/resource/integration/chat/preset/vue/integration.md +0 -5
  15. package/resource/integration/livekit/preset/live/android/live-host-integration.md +0 -4
  16. package/resource/integration/livekit/preset/live/ios/live-host-integration.md +0 -4
  17. package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +0 -4
  18. package/resource/knowledge/callkit/preset/harmonyos/integration.md +0 -4
  19. package/resource/knowledge/chat/preset/android-view/integration.md +0 -4
  20. package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -4
  21. package/resource/knowledge/chat/preset/react/h5/integration.md +0 -5
  22. package/resource/knowledge/chat/preset/vue/h5/integration.md +0 -5
  23. package/resource/knowledge/roomkit/preset/android/integration.md +0 -4
  24. package/resource/knowledge/roomkit/preset/flutter/integration.md +0 -4
  25. package/resource/knowledge/roomkit/preset/harmonyos/integration.md +0 -4
  26. package/resource/knowledge/roomkit/preset/ios/integration.md +0 -4
  27. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +0 -4
  28. package/server.js +42 -34
  29. package/tools/common/get_usersig.js +1 -1
  30. package/tools/common/present_framework_choice.js +5 -5
  31. package/tools/definitions/finalize_answer_def.js +17 -16
  32. package/tools/definitions/get_native_call_uikit_integration_def.js +25 -16
  33. package/tools/definitions/get_native_callkit_core_integration_def.js +37 -26
  34. package/tools/definitions/get_native_chat_uikit_integration_def.js +22 -13
  35. package/tools/definitions/get_native_live_uikit_integration_def.js +30 -21
  36. package/tools/definitions/get_native_livekit_core_integration_def.js +25 -16
  37. package/tools/definitions/get_usersig_def.js +20 -13
  38. package/tools/definitions/get_web_call_uikit_integration_def.js +21 -12
  39. package/tools/definitions/get_web_chat_uikit_integration_def.js +22 -13
  40. package/tools/definitions/get_web_live_uikit_integration_def.js +21 -12
  41. package/tools/definitions/get_web_room_core_integration_def.js +29 -20
  42. package/tools/definitions/get_web_room_uikit_integration_def.js +21 -12
  43. package/tools/definitions/integration-boundary.js +9 -5
  44. package/tools/definitions/present_framework_choice_def.js +21 -21
  45. package/tools/definitions/search_trtc_knowledge_def.js +48 -26
  46. package/tools/definitions/submit_feedback_def.js +18 -14
  47. package/utils/report-cls-client.js +1 -1
  48. 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.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.6",
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',
@@ -1,56 +1,67 @@
1
1
  import { INTEGRATION_BOUNDARY_SUFFIX } from './integration-boundary.js';
2
2
  const TOOL_DESCRIPTION = `
3
- 用途:
4
- 返回基于 AtomicXCore SDK 的 Native CallKit Core 基础集成文档,适合需要自定义通话界面(无预制 UI)的开发者完成拨打、接听和离线推送的接入。
3
+ Purpose:
4
+ Return Native CallKit Core integration docs for explicit codegen implementation.
5
5
 
6
- 典型适用问题(共用触发词,可能同时命中 'get_native_call_uikit_integration' preset 工具):
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 CallKit Core integration documentation based on AtomicXCore SDK, for custom calling UI (no preset UI) including call, answer, and offline push flows.
14
+
15
+ Common trigger lexicon (may overlap with 'get_native_call_uikit_integration' preset 工具):
7
16
  集成 CallKit, 接入 CallKit, 音视频通话, 语音通话, 视频通话, 1v1 通话, 多人通话, 通话功能, 拨打电话, 接听电话, 来电, 离线推送, VoIP
8
- 命中以上共用触发词时,请**先主动追问用户**:"您希望使用默认通话界面快速集成(TUICallKit preset),还是基于 Core SDK 自定义通话界面?" 用户选择"自定义/Core"后再调用本工具;选择"默认/preset"则调用 'get_native_call_uikit_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 custom/Core; if user chooses preset/default, call 'get_native_call_uikit_integration'.
9
18
 
10
- 典型适用问题(Core SDK 专属触发词,仅命中本工具,无需追问,直接调用):
19
+ Core-SDK-only trigger lexicon (direct call, no clarification needed):
11
20
  Core SDK, AtomicXCore, 无 UI, 自定义 UI, 自定义通话界面, 自己画通话页面, 不用默认 UI, 修改通话样式, CallStore, CallCoreView, DeviceStore
12
21
 
13
- 输入:
22
+ Inputs:
14
23
  - framework: android | ios | flutter | uni-app
15
- - goals: 功能模块列表(make_call | answer_call | offline_push)
16
- - prompt: 用户的原始问题全文,保留完整上下文,不要压缩成关键词摘要
24
+ - goals: Feature module list (make_call | answer_call | offline_push)
25
+ - prompt: Original user question. Keep full context; do not compress into keyword summary.
17
26
 
18
- 返回:
19
- - content: [{ type: 'text', text: 文档正文或说明文本 }]
27
+ Outputs:
28
+ - content: [{ type: 'text', text: Documentation body or explanatory text }]
20
29
 
21
- 边界:
22
- - 当用户未明确平台或框架时,应先调用 'present_framework_choice'
23
- - framework=uni-app 时仅支持本工具(Core SDK),不存在 TUICallKit preset 路径;用户选 uni-app 后**不要**再追问"默认 UI vs 自定义 UI",直接调用本工具
24
- - framework=uni-app 且 goals 包含 offline_push 时,本工具会返回降级说明文本(uni-app Core 暂无离线推送集成文档),请引导用户参考 Android / iOS offline-push 文档结合 uni-app 原生插件机制自行接入 FCM / APNs,或改用 TUICallKit preset 方案
25
- - 面向 Core / Store 级基础集成主路径(CallStore 拨打与接听 + 离线推送),不负责美颜、虚拟背景、悬浮窗、画中画等单功能 API 设置
26
- - 返回的是 Core SDK 基础集成文档,不是完整的预制 UIKit 页面模板
30
+ Boundaries:
31
+ - If platform/framework is not specified, call 'present_framework_choice' first.
32
+ - For framework=uni-app, only this Core tool is supported (no TUICallKit preset path). Do not ask preset vs custom UI again; call this tool directly.
33
+ - If framework=uni-app and goals include offline_push, this tool returns a fallback note (no official uni-app Core offline-push doc yet). Guide user to Android/iOS offline-push docs with native plugin bridging for FCM/APNs, or switch to TUICallKit preset.
34
+ - Focuses on Core/Store-level primary integration path (CallStore call + answer + offline push), not single-feature API tuning such as beauty, virtual background, floating window, or picture-in-picture.
35
+ - Returns Core SDK baseline integration docs, not a complete preset UIKit page template.
27
36
  ${INTEGRATION_BOUNDARY_SUFFIX}
28
37
  `;
29
38
  const PARAMETER_DESCRIPTIONS = {
30
- framework: '目标平台。参数名固定为 framework,禁止传 platform。可选值:android | ios | flutter | uni-app。注意:uni-app 仅支持本工具(Core SDK),不存在 TUICallKit preset 路径;用户选 uni-app 时不需要追问"默认 UI vs 自定义 UI"。',
31
- goals: '功能列表。可选值:make_call(拨打电话)| answer_call(接听电话)| offline_push(离线推送)。允许多选,例如同时需要拨打和接听时传 ["make_call", "answer_call"]。注意:framework=uni-app 且 goals 包含 offline_push 时,本工具会返回降级说明而非完整文档(uni-app Core 暂无离线推送集成示例)。',
32
- prompt: '用户的原始问题全文,保留完整上下文,不要压缩成关键词摘要。',
39
+ framework: 'Target platform. Parameter name must be framework (not platform). Allowed values: android | ios | flutter | uni-app. Note: uni-app supports only this Core tool (no TUICallKit preset path), and no extra preset-vs-custom question is needed.',
40
+ goals: 'Goals list. Allowed values: make_call | answer_call | offline_push. Multi-select is allowed (e.g. ["make_call", "answer_call"]). Note: if framework=uni-app and goals include offline_push, this tool returns fallback guidance instead of full docs (no official uni-app Core offline-push example yet).',
41
+ prompt: 'Original user question. Keep full context; do not compress into keyword summary.',
33
42
  };
34
- const ANTI_HALLUCINATION_HEADER = `本文档基于 AtomicXCore SDK,严禁使用 TUILogin、TUICallKit 等含 UI 的 API。\n\n`;
43
+ const ANTI_HALLUCINATION_HEADER = `This document is based on AtomicXCore SDK. DO NOT use UI-layer APIs such as TUILogin or TUICallKit.\n\n`;
35
44
  const ANTI_HALLUCINATION_CONSTRAINT = `
36
45
  ---
37
- 【AI 代码生成约束 - AtomicXCore 方案】
38
- 本文档使用 AtomicXCore SDK(无 UI 集成方案)。请严格基于文档内容生成代码,禁止引入文档未提及的 API。
46
+ [AI Code Generation Constraints - AtomicXCore]
47
+ This document describes an AtomicXCore (no-UI) integration path.
48
+ Generate code strictly from documented APIs only, and do NOT introduce undocumented classes or methods.
39
49
 
40
- 原则:如果某个 API 或类名在本文档中从未出现,则不要在生成的代码中使用它。
50
+ Rule:
51
+ If an API/class name does not appear in this document, do NOT use it in generated code.
41
52
  `;
42
53
  const UNI_APP_OFFLINE_PUSH_FALLBACK = `
43
54
  # uni-app Core SDK 暂未提供离线推送集成示例
44
55
 
45
- ## 现状
56
+ ## Current status
46
57
  当前 AtomicXCore for uni-app 尚未发布配套的离线推送(FCM / APNs)集成文档与示例代码。
47
58
 
48
- ## 推荐做法
59
+ ## Recommended approach
49
60
  - 参考 Android 平台 \`callkit/core-sdk/android/offline-push.md\`,结合 uni-app 的原生 Android 插件机制接入 FCM Data Message。
50
61
  - 参考 iOS 平台 \`callkit/core-sdk/ios/offline-push.md\`,结合 uni-app 的原生 iOS 插件机制接入 VoIP Push。
51
62
  - 若不希望自行实现原生插件,建议改用 \`get_native_call_uikit_integration\` 工具集成 TUICallKit preset 方案,该方案 uni-app 端已内置离线推送能力。
52
63
 
53
- ## 不要做的事
64
+ ## Do NOT
54
65
  - 不要凭空生成 uni-app Core 的离线推送代码,可能与官方 SDK 行为不一致。
55
66
  - 不要把 Android / iOS 的离线推送代码原样塞进 uni-app 项目,需要走原生插件桥接。
56
67
  `;