@tencent-rtc/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 +56 -53
- 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/server.js +35 -29
- package/tools/common/get_usersig.js +1 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js +13 -7
- package/tools/definitions/get_native_callkit_core_integration_def.js +42 -31
- package/tools/definitions/get_native_chat_uikit_integration_def.js +11 -4
- package/tools/definitions/get_native_live_uikit_integration_def.js +21 -15
- package/tools/definitions/get_native_livekit_core_integration_def.js +11 -4
- package/tools/definitions/get_usersig_def.js +18 -11
- package/tools/definitions/get_web_call_uikit_integration_def.js +11 -4
- package/tools/definitions/get_web_chat_uikit_integration_def.js +11 -4
- package/tools/definitions/get_web_live_uikit_integration_def.js +11 -4
- package/tools/definitions/get_web_room_core_integration_def.js +16 -13
- package/tools/definitions/get_web_room_uikit_integration_def.js +11 -4
- package/tools/definitions/integration-boundary.js +9 -5
- package/tools/definitions/present_framework_choice_def.js +20 -20
- package/tools/definitions/search_trtc_knowledge_def.js +47 -27
- 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
|
+
### Changed
|
|
6
|
+
- Cleaned traffic-entry content in the knowledge base to reduce retrieval noise.
|
|
7
|
+
- Refactored tool definitions: unified invocation boundaries, trigger semantics, and template structures across tools.
|
|
8
|
+
- Adjusted global Workflow semantics to be consultation-flow-only, reducing tool-routing ambiguity.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Fixed boundary conflicts and inconsistent parameter wording in some integration tool definitions (for example, `get_native_callkit_core_integration`), improving invocation stability.
|
|
12
|
+
|
|
3
13
|
## Version 1.7.5 @2026.09.04
|
|
4
14
|
|
|
5
15
|
### Changed
|
package/README.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
## Tencent RTC SDK MCP Server
|
|
1
|
+
## Tencent RTC SDK MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Tencent RTC SDK MCP Server exposes official Tencent Cloud RTC knowledge and integration capabilities to AI assistants through MCP (Model Context Protocol), helping teams deliver Chat/Call/Live/Room/RTCEngine/TIMPush implementations faster.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Highlights
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **Reliable source**: Grounded in official Tencent Cloud materials to improve answer reliability and implementation readiness.
|
|
12
|
-
- **Wide compatibility**: Exposes MCP capabilities over STDIN/STDOUT JSON-RPC, compatible with MCP clients such as Cursor / Codex / Claude / CodeBuddy.
|
|
13
|
-
- **Quick start**: Run with `npx` and get started with minimal setup.
|
|
7
|
+
- **Official knowledge retrieval**: Quickly locate product docs, integration guides, and best practices.
|
|
8
|
+
- **Intent-aware routing**: Routes by product, platform, and framework to reduce retrieval noise.
|
|
9
|
+
- **Integration generation support**: Supports Web / Android / iOS / Flutter integration entry points.
|
|
10
|
+
- **MCP compatible**: Works with Cursor, CodeBuddy, Codex, Claude, and other MCP clients.
|
|
14
11
|
|
|
15
12
|
## Requirements
|
|
16
|
-
- Node.js (>= 18) and npm
|
|
17
|
-
- An MCP-capable IDE
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
- Node.js >= 18
|
|
15
|
+
- npm
|
|
16
|
+
- Any MCP-capable IDE / AI client
|
|
21
17
|
|
|
22
|
-
-
|
|
18
|
+
## 30-Second Quick Start (No console app creation required)
|
|
19
|
+
|
|
20
|
+
### 1) Configure MCP Server (Trial mode)
|
|
21
|
+
|
|
22
|
+
Using Cursor as an example, add this to your project `.cursor/mcp.json` (or `~/.cursor/mcp.json`):
|
|
23
23
|
|
|
24
24
|
```json
|
|
25
25
|
{
|
|
@@ -28,67 +28,70 @@ This repository provides a CLI-based Model Context Protocol (MCP) Server that ex
|
|
|
28
28
|
"command": "npx",
|
|
29
29
|
"args": ["-y", "@tencent-rtc/mcp@latest"],
|
|
30
30
|
"env": {
|
|
31
|
-
"SDKAPPID": "
|
|
32
|
-
"SECRETKEY": "
|
|
31
|
+
"SDKAPPID": "",
|
|
32
|
+
"SECRETKEY": ""
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
```
|
|
38
|
-
After saving, a prompt appears. Click **Enable** in the prompt.
|
|
39
|
-
|
|
40
|
-

|
|
41
38
|
|
|
42
|
-
|
|
39
|
+
### 2) Confirm server is connected
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
In your MCP panel, ensure `tencent-rtc` shows **Connected**.
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
### 3) Explicitly trigger tools
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
For higher tool activation rate and more stable results, prefix your prompt with `@tencent-rtc`.
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
Example:
|
|
51
48
|
|
|
52
|
-
```
|
|
53
|
-
|
|
49
|
+
```text
|
|
50
|
+
@tencent-rtc How do I send an audio message when integrating the Web IM SDK in H5?
|
|
54
51
|
```
|
|
55
52
|
|
|
56
|
-
##
|
|
53
|
+
## Full Configuration (Requires creating an app in console)
|
|
57
54
|
|
|
58
|
-
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"tencent-rtc": {
|
|
59
|
+
"command": "npx",
|
|
60
|
+
"args": ["-y", "@tencent-rtc/mcp@latest"],
|
|
61
|
+
"env": {
|
|
62
|
+
"SDKAPPID": "YOUR_SDKAPPID",
|
|
63
|
+
"SECRETKEY": "YOUR_SECRET_KEY"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
59
69
|
|
|
60
|
-
|
|
70
|
+
Console entries: `https://console.trtc.io`
|
|
61
71
|
|
|
62
|
-
|
|
63
|
-
- Refactored the `preflight-route` decision model to an **agent-first, minimal-correction** strategy: prioritize agent-provided `product/frameworks`, and use prompt signals only for high-confidence corrections and narrowing to avoid unsupported expansion.
|
|
64
|
-
- Optimized framework-axis conflict handling: added/enhanced strong-lock strategies for `react-native` and `miniprogram`, and in strong-lock scenarios, separated host environment (`android/ios`) from the actual framework to reduce over-narrowing.
|
|
65
|
-
- Optimized native TRTC correction: when the prompt matches native TRTC classes/methods and no WebRTC hard signal is present, narrow `rtcengine` to `native_trtc_sdk` to reduce web/native cross-routing risk.
|
|
72
|
+
## Prerequisites
|
|
66
73
|
|
|
67
|
-
|
|
68
|
-
-
|
|
74
|
+
- **No account / no app yet? You can still try first**: Start with document retrieval and knowledge Q&A in trial mode.
|
|
75
|
+
- `SDKAPPID`: Your IM/TRTC application ID from Tencent Cloud console.
|
|
76
|
+
- `SECRETKEY`: Used for local/test `userSig` generation.
|
|
77
|
+
- **Production requirement**: `userSig` must be generated by your server-side service.
|
|
69
78
|
|
|
70
|
-
##
|
|
79
|
+
## Common Issues
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
- Added CallKit HarmonyOS platform support: UIKit integration guide and API reference.
|
|
76
|
-
- Added CallKit Mini Program & uni-app docs: UIKit integration guide, API reference, uni-app packaging guide.
|
|
77
|
-
- Added CallKit uni-app (Android/iOS) standalone integration docs and API reference.
|
|
78
|
-
- Added Chat Vue3/React H5 mobile integration docs.
|
|
81
|
+
- **Connection failed / tool not activated**: Verify MCP config and Connected status.
|
|
82
|
+
- **`npx` failures**: Retry after cache cleanup: `rm -rf ~/.npm/_npx && npm cache verify`.
|
|
83
|
+
- **Invalid `userSig`**: Regenerate via `get_usersig`.
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
- Optimized Chat UIKit search tags: vue/react framework changed from single tag to dual tags (`['vue','web']` / `['react','web']`), allowing `frameworks=['web']` to match Chat Web docs.
|
|
85
|
+
## Changelog
|
|
82
86
|
|
|
83
|
-
|
|
87
|
+
> Only the latest release is shown here. See `CHANGELOG.md` for full history.
|
|
84
88
|
|
|
85
|
-
|
|
86
|
-
- Added knowledge base resources for RoomKit multi-platform integration, recording, whiteboard, network proxy, AI noise reduction, and subtitle translation, expanding coverage of the Room product domain.
|
|
87
|
-
- Added best-practice docs covering error codes, log levels, automatic screen-share stop, and WeChat Mini Program error troubleshooting.
|
|
88
|
-
- Added a generic additive rerank module with anchor selection and phrase extraction, integrated into the search reranking logic to improve recall ranking accuracy.
|
|
89
|
+
## Version 1.7.6 @2026.09.09
|
|
89
90
|
|
|
90
91
|
### Changed
|
|
91
|
-
-
|
|
92
|
+
- Cleaned traffic-entry content in the knowledge base to reduce retrieval noise.
|
|
93
|
+
- Refactored tool definitions: unified invocation boundaries, trigger semantics, and template structures across tools.
|
|
94
|
+
- Adjusted global Workflow semantics to be consultation-flow-only, reducing tool-routing ambiguity.
|
|
92
95
|
|
|
93
96
|
### Fixed
|
|
94
|
-
- Fixed
|
|
97
|
+
- Fixed boundary conflicts and inconsistent parameter wording in some integration tool definitions (for example, `get_native_callkit_core_integration`), improving invocation stability.
|
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);
|