cls-mcp-server 0.2.1 → 0.2.3
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/README.md +4 -10
- package/dist/index.js +10 -3
- package/package.json +2 -2
package/README.md
CHANGED
@@ -25,7 +25,7 @@ To configure `cls-mcp-server` as an MCP service in stdio transport, add the foll
|
|
25
25
|
"command": "npx",
|
26
26
|
"args": [
|
27
27
|
"-y",
|
28
|
-
"cls-mcp-server"
|
28
|
+
"cls-mcp-server@latest"
|
29
29
|
],
|
30
30
|
"env": {
|
31
31
|
"TRANSPORT": "stdio",
|
@@ -56,19 +56,13 @@ MAX_LENGTH=15000
|
|
56
56
|
PORT=3000
|
57
57
|
```
|
58
58
|
|
59
|
-
2.
|
59
|
+
2. Run command to start sse server
|
60
60
|
|
61
61
|
```
|
62
|
-
|
62
|
+
npx -y cls-mcp-server@latest
|
63
63
|
```
|
64
64
|
|
65
|
-
3.
|
66
|
-
|
67
|
-
```
|
68
|
-
cls-mcp-server
|
69
|
-
```
|
70
|
-
|
71
|
-
4. Config your `mcpServers` settings
|
65
|
+
3. Config your `mcpServers` settings
|
72
66
|
|
73
67
|
```json
|
74
68
|
{
|
package/dist/index.js
CHANGED
@@ -12,7 +12,7 @@ const express_1 = __importDefault(require("express"));
|
|
12
12
|
const tencentcloud_sdk_nodejs_cls_1 = require("tencentcloud-sdk-nodejs-cls");
|
13
13
|
const tencentcloud_sdk_nodejs_region_1 = require("tencentcloud-sdk-nodejs-region");
|
14
14
|
const zod_1 = require("zod");
|
15
|
-
console.log(process.env); // remove this after you've confirmed it is working
|
15
|
+
// console.log(process.env); // remove this after you've confirmed it is working
|
16
16
|
const ClsClient = tencentcloud_sdk_nodejs_cls_1.cls.v20201016.Client;
|
17
17
|
const RegionClient = tencentcloud_sdk_nodejs_region_1.region.v20220627.Client;
|
18
18
|
// Initialize MCP server
|
@@ -283,6 +283,7 @@ function main() {
|
|
283
283
|
if (transport === 'sse') {
|
284
284
|
const app = (0, express_1.default)();
|
285
285
|
let transport = null;
|
286
|
+
const port = process.env.PORT ? Number(process.env.PORT) : 3000;
|
286
287
|
app.get('/sse', (req, res) => {
|
287
288
|
transport = new sse_js_1.SSEServerTransport('/messages', res);
|
288
289
|
mcpServer.connect(transport).catch((error) => {
|
@@ -295,11 +296,17 @@ function main() {
|
|
295
296
|
transport.handlePostMessage(req, res);
|
296
297
|
}
|
297
298
|
});
|
298
|
-
app.listen(
|
299
|
+
app.listen(port);
|
300
|
+
console.log(`Started cls-mcp-server in sse transport on port ${port}.`);
|
299
301
|
}
|
300
302
|
else {
|
301
303
|
const stdioTransport = new stdio_js_1.StdioServerTransport();
|
302
|
-
mcpServer
|
304
|
+
mcpServer
|
305
|
+
.connect(stdioTransport)
|
306
|
+
.then(() => {
|
307
|
+
console.log(`Started cls-mcp-server in stdio transport.`);
|
308
|
+
})
|
309
|
+
.catch((error) => {
|
303
310
|
console.error('Fatal error in main():', error);
|
304
311
|
process.exit(error?.code || 1);
|
305
312
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cls-mcp-server",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.3",
|
4
4
|
"main": "index.js",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -12,7 +12,7 @@
|
|
12
12
|
"build": "tsc && chmod 755 dist/index.js",
|
13
13
|
"lint": "eslint -c .eslintrc.js --fix --quiet src/**/*.ts src/**/*.tsx",
|
14
14
|
"prepare": "husky",
|
15
|
-
"publish": "npm run build && npm publish --registry=\"https://registry.npmjs.org/\"",
|
15
|
+
"publish:npm": "npm run build && npm publish --registry=\"https://registry.npmjs.org/\"",
|
16
16
|
"postinstall": "patch-package",
|
17
17
|
"start:sse": "npm run build && node ./dist/index.js"
|
18
18
|
},
|