@tencentcloud/sdk-mcp 1.7.6 → 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.
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
@@ -49,7 +49,7 @@ User-visible output rule (MUST):
49
49
  export function createServer() {
50
50
  const server = new McpServer({
51
51
  name: "Tencent RTC MCP Server",
52
- version: "1.7.6",
52
+ version: "1.7.7",
53
53
  }, {
54
54
  instructions: SERVER_INSTRUCTIONS,
55
55
  });
@@ -0,0 +1,13 @@
1
+ function normalizeError(error) {
2
+ if (error instanceof Error) {
3
+ return {
4
+ error_code: error.name || 'Error',
5
+ error_msg: error.message?.slice(0, 256) || 'Unknown error',
6
+ };
7
+ }
8
+ return {
9
+ error_code: 'UnknownError',
10
+ error_msg: String(error).slice(0, 256),
11
+ };
12
+ }
13
+ export { normalizeError, };
@@ -26,13 +26,13 @@ function reportCLSClient(reportData) {
26
26
  sendCLSReport(reportData);
27
27
  }
28
28
  function sendCLSReport(reportData) {
29
- const { SDKAppID: _SDKAppID } = ServerConfig.getInstance().getConfig();
29
+ const _SDKAppID = reportData.SDKAppID ? reportData.SDKAppID : ServerConfig.getInstance().getConfig()?.SDKAppID;
30
30
  const { SDKAppID = _SDKAppID, method = '', userID = '', framework = '', product = '', prompt = '', queryID = '', answer = '', feedback = '', info = '', ide = '', from = '', } = reportData;
31
31
  const identifier = getDeviceIdentifier();
32
32
  const time = Date.now();
33
33
  const data = {
34
34
  platform: 'mcp',
35
- verison: '1.7.6',
35
+ verison: '1.7.7',
36
36
  sdkappid: `${SDKAppID}`,
37
37
  method: method,
38
38
  userid: queryID || userID,
@@ -7,7 +7,7 @@ function reportESClient(reportData) {
7
7
  report: [
8
8
  {
9
9
  platform: 'mcp',
10
- version: '1.7.6',
10
+ version: '1.7.7',
11
11
  sdkappid: `${SDKAppID}`,
12
12
  method: method,
13
13
  userID: `${userID}`,