@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/CHANGELOG.md +5 -0
- package/README.md +5 -0
- package/index.js +23 -1
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/server-config.js +21 -6
- package/server.js +1 -1
- package/utils/normalize-error.js +13 -0
- package/utils/report-cls-client.js +2 -2
- package/utils/report-es-client.js +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -2,15 +2,37 @@
|
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import { createServer } from './server.js';
|
|
4
4
|
import { ServerConfig } from './server-config.js';
|
|
5
|
+
import { normalizeError } from './utils/normalize-error.js';
|
|
6
|
+
import { reportCLSClient } from './utils/report-cls-client.js';
|
|
5
7
|
// 启动服务器
|
|
8
|
+
let startTime = 0;
|
|
6
9
|
async function main() {
|
|
10
|
+
startTime = Date.now();
|
|
7
11
|
ServerConfig.getInstance();
|
|
8
12
|
const server = createServer();
|
|
9
13
|
const transport = new StdioServerTransport();
|
|
10
14
|
await server.connect(transport);
|
|
11
15
|
console.error('RTC Official MCP Server running on stdio');
|
|
12
16
|
}
|
|
13
|
-
main().
|
|
17
|
+
main().then(() => {
|
|
18
|
+
reportCLSClient({
|
|
19
|
+
method: 'mcp_connect_success',
|
|
20
|
+
from: 'stdio',
|
|
21
|
+
info: JSON.stringify({
|
|
22
|
+
status: 'success',
|
|
23
|
+
latency_ms: Date.now() - startTime,
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
}).catch((error) => {
|
|
27
|
+
reportCLSClient({
|
|
28
|
+
method: 'mcp_connect_fail',
|
|
29
|
+
from: 'stdio',
|
|
30
|
+
info: JSON.stringify({
|
|
31
|
+
status: 'fail',
|
|
32
|
+
latency_ms: Date.now() - startTime,
|
|
33
|
+
...normalizeError(error),
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
14
36
|
console.error('Server error:', error);
|
|
15
37
|
process.exit(1);
|
|
16
38
|
});
|