@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.
- package/CHANGELOG.md +10 -0
- package/README.md +57 -54
- package/knowledge/chunker.js +1 -0
- package/knowledge/path-meta.js +12 -1
- package/knowledge/search/search-core.js +22 -4
- package/knowledge/search/search-knowledge.js +1 -1
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +0 -4
- package/resource/integration/callkit/preset/flutter/integration.md +0 -4
- package/resource/integration/callkit/preset/ios/integration.md +0 -4
- package/resource/integration/chat/preset/react/integration.md +0 -5
- package/resource/integration/chat/preset/uni-app/integration.md +0 -4
- package/resource/integration/chat/preset/vue/integration.md +0 -5
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +0 -4
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +0 -4
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +0 -4
- package/resource/knowledge/callkit/preset/harmonyos/integration.md +0 -4
- package/resource/knowledge/chat/preset/android-view/integration.md +0 -4
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -4
- package/resource/knowledge/chat/preset/react/h5/integration.md +0 -5
- package/resource/knowledge/chat/preset/vue/h5/integration.md +0 -5
- package/resource/knowledge/roomkit/preset/android/integration.md +0 -4
- package/resource/knowledge/roomkit/preset/flutter/integration.md +0 -4
- package/resource/knowledge/roomkit/preset/harmonyos/integration.md +0 -4
- package/resource/knowledge/roomkit/preset/ios/integration.md +0 -4
- package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +0 -4
- package/server.js +42 -34
- package/tools/common/get_usersig.js +1 -1
- package/tools/common/present_framework_choice.js +5 -5
- package/tools/definitions/finalize_answer_def.js +17 -16
- package/tools/definitions/get_native_call_uikit_integration_def.js +25 -16
- package/tools/definitions/get_native_callkit_core_integration_def.js +37 -26
- package/tools/definitions/get_native_chat_uikit_integration_def.js +22 -13
- package/tools/definitions/get_native_live_uikit_integration_def.js +30 -21
- package/tools/definitions/get_native_livekit_core_integration_def.js +25 -16
- package/tools/definitions/get_usersig_def.js +20 -13
- package/tools/definitions/get_web_call_uikit_integration_def.js +21 -12
- package/tools/definitions/get_web_chat_uikit_integration_def.js +22 -13
- package/tools/definitions/get_web_live_uikit_integration_def.js +21 -12
- package/tools/definitions/get_web_room_core_integration_def.js +29 -20
- package/tools/definitions/get_web_room_uikit_integration_def.js +21 -12
- package/tools/definitions/integration-boundary.js +9 -5
- package/tools/definitions/present_framework_choice_def.js +21 -21
- package/tools/definitions/search_trtc_knowledge_def.js +48 -26
- package/tools/definitions/submit_feedback_def.js +18 -14
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## Version 1.7.6 @2026.09.09
|
|
4
|
+
|
|
5
|
+
### 变更
|
|
6
|
+
- 清理知识库中引流入口信息,减少知识库检索噪声。
|
|
7
|
+
- 重构工具定义:统一工具的调用边界、触发语义和模板结构。
|
|
8
|
+
- 调整全局 Workflow 语义为“咨询流专用”,降低工具路由歧义。
|
|
9
|
+
|
|
10
|
+
### 修复
|
|
11
|
+
- 修复部分集成工具定义中的边界冲突与参数文案不一致问题(如 `get_native_callkit_core_integration`),提升调用稳定性。
|
|
12
|
+
|
|
3
13
|
## Version 1.7.5 @2026.09.04
|
|
4
14
|
|
|
5
15
|
### 变更
|
package/README.md
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
## 腾讯云 SDK MCP Server
|
|
1
|
+
## 腾讯云 SDK MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
腾讯云 SDK MCP Server 通过 MCP(Model Context Protocol)向 AI 助手提供官方文档检索与集成能力,帮助你更快完成腾讯云实时音视频相关开发(Chat/Call/Live/Room/RTCEngine/TIMPush)。
|
|
4
4
|
|
|
5
|
+
## 功能概览
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- **智能路由**:支持产品/平台语义识别与消歧,在必要时引导补齐平台与框架信息。
|
|
11
|
-
- **集成友好**:除文档问答外,提供 Web / Android / iOS / Flutter 等含 UI 集成入口。
|
|
12
|
-
- **官方可信**:基于官方资料,提升答案可靠性与可落地性。
|
|
13
|
-
- **广泛兼容**:通过 STDIN/STDOUT 的 JSON-RPC 提供 MCP 能力,可接入 Cursor / Codex / Claude / CodeBuddy 等 MCP 客户端。
|
|
14
|
-
- **开箱即用**:`npx` 即可运行,低接入门槛。
|
|
7
|
+
- **官方资料检索**:快速定位产品文档、集成指引与最佳实践。
|
|
8
|
+
- **智能分流**:按产品、平台、框架进行语义路由,降低检索噪声。
|
|
9
|
+
- **代码集成能力**:支持 Web / Android / iOS / Flutter 等主流端侧集成入口。
|
|
10
|
+
- **MCP 兼容**:可接入 Cursor、CodeBuddy、Codex、Claude 等 MCP 客户端。
|
|
15
11
|
|
|
16
12
|
## 环境要求
|
|
17
|
-
- Node.js(>= 18)与 npm
|
|
18
|
-
- 支持 MCP 的 IDE
|
|
19
13
|
|
|
14
|
+
- Node.js >= 18
|
|
15
|
+
- npm
|
|
16
|
+
- 任一支持 MCP 的 IDE / AI 客户端
|
|
17
|
+
|
|
18
|
+
## 30 秒快速开始(免控制台创建应用试用)
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
### 标准接入流程
|
|
20
|
+
### 1) 配置 MCP Server(试用模式)
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
以 Cursor 为例,在项目 `.cursor/mcp.json`(或 `~/.cursor/mcp.json`)中添加:
|
|
25
23
|
|
|
26
24
|
```json
|
|
27
25
|
{
|
|
@@ -30,67 +28,72 @@
|
|
|
30
28
|
"command": "npx",
|
|
31
29
|
"args": ["-y", "@tencentcloud/sdk-mcp@latest"],
|
|
32
30
|
"env": {
|
|
33
|
-
"SDKAPPID": "
|
|
34
|
-
"SECRETKEY": "
|
|
31
|
+
"SDKAPPID": "",
|
|
32
|
+
"SECRETKEY": ""
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
```
|
|
40
|
-
保存后会弹出提示,在提示中点击 **Enable**。
|
|
41
38
|
|
|
42
|
-
|
|
39
|
+
### 2) 确认服务已连接
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
在 MCP 面板确认 `tencentcloud-sdk-mcp` 状态为 **Connected**。
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
### 3) 用前缀显式激活工具
|
|
47
44
|
|
|
48
|
-
-
|
|
45
|
+
建议在问题前加 `@tencentcloud-sdk-mcp`,提升工具命中率与回答稳定性。
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
示例:
|
|
51
48
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx -y @tencentcloud/sdk-mcp
|
|
49
|
+
```text
|
|
50
|
+
@tencentcloud-sdk-mcp H5 集成 Web IM SDK 怎么发送语音消息?
|
|
56
51
|
```
|
|
57
52
|
|
|
58
|
-
##
|
|
53
|
+
## 完整配置(需要在控制台创建应用)
|
|
59
54
|
|
|
60
|
-
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"tencentcloud-sdk-mcp": {
|
|
59
|
+
"command": "npx",
|
|
60
|
+
"args": ["-y", "@tencentcloud/sdk-mcp@latest"],
|
|
61
|
+
"env": {
|
|
62
|
+
"SDKAPPID": "YOUR_SDKAPPID",
|
|
63
|
+
"SECRETKEY": "YOUR_SECRET_KEY"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
61
69
|
|
|
62
|
-
|
|
70
|
+
控制台入口:
|
|
71
|
+
- 即时通信 IM 控制台:`https://console.cloud.tencent.com/im`
|
|
72
|
+
- 音视频 TRTC 控制台:`https://console.cloud.tencent.com/trtc`
|
|
63
73
|
|
|
64
|
-
|
|
65
|
-
- 重构 `preflight-route` 决策模型为 **agent-first 最小纠偏**:以 agent 传入的 `product/frameworks` 为主,prompt 仅用于高置信纠错与收窄,避免无证扩张。
|
|
66
|
-
- 优化框架轴冲突处理:新增/强化 `react-native`、`miniprogram` 强锁策略,并在强锁场景下区分 host-env(`android/ios`)与真实 framework,减少误收窄。
|
|
67
|
-
- 优化 native TRTC 纠偏:当 prompt 命中 native TRTC 类/方法且无 WebRTC 硬信号时,将 `rtcengine` 收窄为 `native_trtc_sdk`,降低 web/native 串场景风险。
|
|
74
|
+
## 接入准备说明
|
|
68
75
|
|
|
69
|
-
|
|
70
|
-
-
|
|
76
|
+
- **无账号/未创建应用也可先试用**:可先体验文档检索与知识咨询能力。
|
|
77
|
+
- `SDKAPPID`:你的 IM/TRTC 应用 ID(控制台获取)。
|
|
78
|
+
- `SECRETKEY`:用于测试生成 `userSig`。
|
|
79
|
+
- **生产环境要求**:`userSig` 必须由服务端签发,不建议长期使用本地测试签发方式。
|
|
71
80
|
|
|
72
|
-
##
|
|
81
|
+
## 常见问题
|
|
73
82
|
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
- 新增 CallKit HarmonyOS 平台支持:含 UI 集成指南与 API 参考文档。
|
|
78
|
-
- 新增 CallKit 小程序 & uni-app 集成文档:含 UI 集成指南、API 参考、uni-app 打包指南。
|
|
79
|
-
- 新增 CallKit uni-app(Android/iOS)独立集成文档与 API 参考。
|
|
80
|
-
- 新增 Chat Vue3/React H5 移动端集成文档。
|
|
83
|
+
- **连接失败/工具未激活**:检查 MCP 配置是否生效,确认服务状态为 Connected。
|
|
84
|
+
- **`npx` 异常**:可清理 `npx` 缓存后重试:`rm -rf ~/.npm/_npx && npm cache verify`。
|
|
85
|
+
- **`userSig` 无效**:重新调用 `get_usersig` 生成。
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
- 优化 Chat 含 UI 检索标签:vue/react 的 framework 从单标签改为双标签(`['vue','web']` / `['react','web']`),使 `frameworks=['web']` 也能命中 Chat Web 端文档。
|
|
87
|
+
## 更新记录
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
> 仅展示最近更新,完整历史请查看 `CHANGELOG.md`。
|
|
86
90
|
|
|
87
|
-
|
|
88
|
-
- 新增 RoomKit 多端集成、录制、白板、网络代理、AI 降噪与字幕翻译等知识库资源,扩充 Room 产品域知识覆盖。
|
|
89
|
-
- 新增错误码、日志级别、屏幕分享自动停止及微信小程序报错排查等最佳实践文档。
|
|
90
|
-
- 新增通用加性 rerank 模块,实现锚点选择与短语提取,并集成到搜索重排逻辑,提升召回排序准确率。
|
|
91
|
+
## Version 1.7.6 @2026.09.09
|
|
91
92
|
|
|
92
93
|
### 变更
|
|
93
|
-
-
|
|
94
|
+
- 清理知识库中引流入口信息,减少知识库检索噪声。
|
|
95
|
+
- 重构工具定义:统一工具的调用边界、触发语义和模板结构。
|
|
96
|
+
- 调整全局 Workflow 语义为“咨询流专用”,降低工具路由歧义。
|
|
94
97
|
|
|
95
98
|
### 修复
|
|
96
|
-
-
|
|
99
|
+
- 修复部分集成工具定义中的边界冲突与参数文案不一致问题(如 `get_native_callkit_core_integration`),提升调用稳定性。
|
package/knowledge/chunker.js
CHANGED
|
@@ -125,6 +125,7 @@ function buildChunk(meta, source, title, body, id, char_start, char_end, extra)
|
|
|
125
125
|
types: meta.types,
|
|
126
126
|
scenario: meta.scenario,
|
|
127
127
|
variant: meta.variant,
|
|
128
|
+
platform: meta.platform,
|
|
128
129
|
scope: meta.scope,
|
|
129
130
|
doc_kind: meta.doc_kind,
|
|
130
131
|
capability_status: meta.capability_status,
|
package/knowledge/path-meta.js
CHANGED
|
@@ -65,6 +65,7 @@ export function inferPathMeta(relativeSource) {
|
|
|
65
65
|
let types = corpus === 'integration' ? ['integration'] : [];
|
|
66
66
|
let scenario = null;
|
|
67
67
|
let variant;
|
|
68
|
+
let platform;
|
|
68
69
|
let doc_kind;
|
|
69
70
|
let capability_status;
|
|
70
71
|
let retrievable_scope;
|
|
@@ -78,10 +79,19 @@ export function inferPathMeta(relativeSource) {
|
|
|
78
79
|
else if (normalized.startsWith('knowledge/chat/') || normalized.startsWith('integration/chat/')) {
|
|
79
80
|
product = 'chat';
|
|
80
81
|
if (parts.includes('preset') && parts.length >= 4) {
|
|
81
|
-
const
|
|
82
|
+
const presetIdx = parts.indexOf('preset');
|
|
83
|
+
const fw = normalizeFrameworkDir(parts[presetIdx + 1]);
|
|
84
|
+
const platformSegment = String(parts[presetIdx + 2] ?? '').toLowerCase();
|
|
82
85
|
// vue/react 运行在 Web/H5 端,追加 web 标签,使 frameworks=['web'] 也能命中
|
|
83
86
|
framework = (fw === 'vue' || fw === 'react') ? [fw, 'web'] : [fw];
|
|
84
87
|
variant = 'preset';
|
|
88
|
+
// 仅在显式 h5/mobile 路径时标记为移动网页;默认按 desktop 处理,避免误伤 native 路由
|
|
89
|
+
if (platformSegment === 'h5' || platformSegment === 'mobile') {
|
|
90
|
+
platform = 'mobile';
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
platform = 'desktop';
|
|
94
|
+
}
|
|
85
95
|
// preset 下的 integration.md 显式标记 integration type
|
|
86
96
|
if (fileName.toLowerCase() === 'integration.md') {
|
|
87
97
|
types.push('integration');
|
|
@@ -371,6 +381,7 @@ export function inferPathMeta(relativeSource) {
|
|
|
371
381
|
scenario,
|
|
372
382
|
corpus,
|
|
373
383
|
variant,
|
|
384
|
+
platform,
|
|
374
385
|
scope,
|
|
375
386
|
doc_kind,
|
|
376
387
|
capability_status,
|
|
@@ -151,16 +151,24 @@ export function sourceTitle(source) {
|
|
|
151
151
|
const base = source.split('/').pop()?.replace(/\.md$/i, '') ?? source;
|
|
152
152
|
return base || source;
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
function detectH5Intent(prompt) {
|
|
155
|
+
return /(\bh5\b|移动端网页|手机网页|mobile\s*web|web\s*mobile)/i.test(prompt);
|
|
156
|
+
}
|
|
157
|
+
function hasNativeIntent(prompt) {
|
|
158
|
+
return /(android|ios|flutter|react\s*native|react-native|uni-?app|harmonyos|鸿蒙|原生|小程序|miniprogram)/i.test(prompt);
|
|
159
|
+
}
|
|
160
|
+
export function pickNarrativeSource(prompt, ranked, poolWithContent) {
|
|
155
161
|
const bySource = new Map();
|
|
156
162
|
const chunksById = new Map(poolWithContent.map((chunk) => [chunk.id, chunk]));
|
|
157
|
-
const
|
|
163
|
+
const h5BoostEnabled = detectH5Intent(prompt) && !hasNativeIntent(prompt);
|
|
164
|
+
const upsertSource = (source, score, weight, platform) => {
|
|
158
165
|
const prev = bySource.get(source);
|
|
159
166
|
if (!prev) {
|
|
160
167
|
bySource.set(source, {
|
|
161
168
|
hitCount: 1,
|
|
162
169
|
bestScore: score,
|
|
163
170
|
weightedScore: score * weight,
|
|
171
|
+
platform,
|
|
164
172
|
});
|
|
165
173
|
return;
|
|
166
174
|
}
|
|
@@ -168,6 +176,7 @@ export function pickNarrativeSource(_exactHits, ranked, poolWithContent) {
|
|
|
168
176
|
hitCount: prev.hitCount + 1,
|
|
169
177
|
bestScore: Math.max(prev.bestScore, score),
|
|
170
178
|
weightedScore: prev.weightedScore + score * weight,
|
|
179
|
+
platform: prev.platform ?? platform,
|
|
171
180
|
});
|
|
172
181
|
};
|
|
173
182
|
const topScore = ranked[0]?.score ?? 0;
|
|
@@ -178,12 +187,21 @@ export function pickNarrativeSource(_exactHits, ranked, poolWithContent) {
|
|
|
178
187
|
continue;
|
|
179
188
|
if (topScore > 0 && idx > 120 && item.score < topScore * 0.03)
|
|
180
189
|
break;
|
|
181
|
-
|
|
182
|
-
|
|
190
|
+
let weight = idx < 20 ? 1 : idx < 80 ? 0.7 : 0.5;
|
|
191
|
+
if (h5BoostEnabled && chunk.platform === 'mobile') {
|
|
192
|
+
weight *= 1.3;
|
|
193
|
+
}
|
|
194
|
+
upsertSource(chunk.source, item.score, weight, chunk.platform);
|
|
183
195
|
}
|
|
184
196
|
const candidates = [...bySource.entries()].sort((a, b) => {
|
|
185
197
|
if (b[1].weightedScore !== a[1].weightedScore)
|
|
186
198
|
return b[1].weightedScore - a[1].weightedScore;
|
|
199
|
+
if (h5BoostEnabled && a[1].platform !== b[1].platform) {
|
|
200
|
+
if (a[1].platform === 'mobile')
|
|
201
|
+
return 1;
|
|
202
|
+
if (b[1].platform === 'mobile')
|
|
203
|
+
return -1;
|
|
204
|
+
}
|
|
187
205
|
if (b[1].hitCount !== a[1].hitCount)
|
|
188
206
|
return b[1].hitCount - a[1].hitCount;
|
|
189
207
|
return b[1].bestScore - a[1].bestScore;
|
|
@@ -340,7 +340,7 @@ export function searchKnowledge(params) {
|
|
|
340
340
|
}
|
|
341
341
|
const resolveNarrativeState = (passSnapshot) => {
|
|
342
342
|
const source = retrievalMode === 'narrative'
|
|
343
|
-
? pickNarrativeSource(
|
|
343
|
+
? pickNarrativeSource(norm.prompt, passSnapshot.rankedWithMultipliers, passSnapshot.poolWithContent)
|
|
344
344
|
: null;
|
|
345
345
|
const document = source ? buildNarrativeDocument(source, allChunks) : null;
|
|
346
346
|
const quality = assessNarrativeCompleteness(document, norm.prompt);
|