create-mcp-kit 0.1.3 → 0.1.4
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/package.json +2 -2
- package/template/client-js/package.json.hbs +7 -7
- package/template/client-ts/package.json.hbs +7 -7
- package/template/server-js/package.json.hbs +7 -7
- package/template/server-js/src/services/index.js.hbs +1 -1
- package/template/server-js/src/services/web.js.hbs +7 -0
- package/template/server-ts/package.json.hbs +9 -9
- package/template/server-ts/src/services/index.ts.hbs +1 -1
- package/template/server-ts/src/services/web.ts.hbs +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mcp-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "A CLI tool to create MCP (Model Context Protocol) applications with ease.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "zhensherlock",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"gradient-string": "^3.0.0",
|
|
49
49
|
"handlebars": "^4.7.8",
|
|
50
50
|
"picocolors": "^1.1.1",
|
|
51
|
-
"@mcp-tool-kit/shared": "^0.1.
|
|
51
|
+
"@mcp-tool-kit/shared": "^0.1.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {},
|
|
54
54
|
"scripts": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepare": "husky"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.21.0",
|
|
31
31
|
"dotenv": "^17.2.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@commitlint/config-conventional": "^20.0.0",
|
|
37
37
|
{{/if}}
|
|
38
38
|
{{#if (includes plugins 'vitest')}}
|
|
39
|
-
"@vitest/coverage-v8": "^4.0.
|
|
39
|
+
"@vitest/coverage-v8": "^4.0.6",
|
|
40
40
|
{{/if}}
|
|
41
41
|
{{#if (includes plugins 'changelog')}}
|
|
42
42
|
"compare-func": "^2.0.0",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"conventional-changelog-cli": "^5.0.0",
|
|
47
47
|
{{/if}}
|
|
48
48
|
"cross-env": "^10.1.0",
|
|
49
|
-
"esbuild": "^0.25.
|
|
49
|
+
"esbuild": "^0.25.12",
|
|
50
50
|
{{#if (includes plugins 'style')}}
|
|
51
|
-
"eslint": "^9.
|
|
51
|
+
"eslint": "^9.39.1",
|
|
52
52
|
"eslint-plugin-import": "^2.32.0",
|
|
53
53
|
"eslint-plugin-prettier": "^5.5.4",
|
|
54
|
-
"globals": "^16.
|
|
54
|
+
"globals": "^16.5.0",
|
|
55
55
|
{{/if}}
|
|
56
56
|
"husky": "^9.1.7",
|
|
57
57
|
{{#if (includes plugins 'style')}}
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"prettier": "^3.6.2",
|
|
60
60
|
{{/if}}
|
|
61
61
|
{{#if (includes plugins 'vitest')}}
|
|
62
|
-
"vitest": "^4.0.
|
|
62
|
+
"vitest": "^4.0.6",
|
|
63
63
|
{{/if}}
|
|
64
|
-
"rimraf": "^6.0
|
|
64
|
+
"rimraf": "^6.1.0"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepare": "husky"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.21.0",
|
|
31
31
|
"dotenv": "^17.2.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@typescript-eslint/parser": "^8.46.2",
|
|
41
41
|
{{/if}}
|
|
42
42
|
{{#if (includes plugins 'vitest')}}
|
|
43
|
-
"@vitest/coverage-v8": "^4.0.
|
|
43
|
+
"@vitest/coverage-v8": "^4.0.6",
|
|
44
44
|
{{/if}}
|
|
45
45
|
{{#if (includes plugins 'changelog')}}
|
|
46
46
|
"compare-func": "^2.0.0",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"conventional-changelog-cli": "^5.0.0",
|
|
52
52
|
{{/if}}
|
|
53
53
|
"cross-env": "^10.1.0",
|
|
54
|
-
"esbuild": "^0.25.
|
|
54
|
+
"esbuild": "^0.25.12",
|
|
55
55
|
{{#if (includes plugins 'style')}}
|
|
56
|
-
"eslint": "^9.
|
|
56
|
+
"eslint": "^9.39.1",
|
|
57
57
|
"eslint-plugin-import": "^2.32.0",
|
|
58
58
|
"eslint-plugin-prettier": "^5.5.4",
|
|
59
|
-
"globals": "^16.
|
|
59
|
+
"globals": "^16.5.0",
|
|
60
60
|
{{/if}}
|
|
61
61
|
"husky": "^9.1.7",
|
|
62
62
|
{{#if (includes plugins 'style')}}
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"tsx": "^4.20.6",
|
|
67
67
|
"typescript": "^5.9.3",
|
|
68
68
|
{{#if (includes plugins 'vitest')}}
|
|
69
|
-
"vitest": "^4.0.
|
|
69
|
+
"vitest": "^4.0.6",
|
|
70
70
|
{{/if}}
|
|
71
|
-
"rimraf": "^6.0
|
|
71
|
+
"rimraf": "^6.1.0"
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"prepare": "husky"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
44
|
+
"@modelcontextprotocol/sdk": "^1.21.0",
|
|
45
45
|
"dotenv": "^17.2.3",
|
|
46
46
|
{{#if (or (includes transports 'streamable') (includes transports 'sse'))}}
|
|
47
47
|
"express": "^5.1.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@modelcontextprotocol/inspector": "^0.17.2",
|
|
60
60
|
{{/if}}
|
|
61
61
|
{{#if (includes plugins 'vitest')}}
|
|
62
|
-
"@vitest/coverage-v8": "^4.0.
|
|
62
|
+
"@vitest/coverage-v8": "^4.0.14",
|
|
63
63
|
"c8": "^10.1.3",
|
|
64
64
|
{{/if}}
|
|
65
65
|
{{#if (includes plugins 'changelog')}}
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
"conventional-changelog-cli": "^5.0.0",
|
|
71
71
|
{{/if}}
|
|
72
72
|
"cross-env": "^10.1.0",
|
|
73
|
-
"esbuild": "^0.25.
|
|
73
|
+
"esbuild": "^0.25.12",
|
|
74
74
|
{{#if (includes plugins 'style')}}
|
|
75
|
-
"eslint": "^9.
|
|
75
|
+
"eslint": "^9.39.1",
|
|
76
76
|
"eslint-plugin-import": "^2.32.0",
|
|
77
77
|
"eslint-plugin-prettier": "^5.5.3",
|
|
78
|
-
"globals": "^16.
|
|
78
|
+
"globals": "^16.5.0",
|
|
79
79
|
{{/if}}
|
|
80
80
|
"husky": "^9.1.7",
|
|
81
81
|
{{#if (includes plugins 'style')}}
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"tree-kill": "^1.2.2",
|
|
92
92
|
{{/if}}
|
|
93
93
|
{{#if (includes plugins 'vitest')}}
|
|
94
|
-
"vitest": "^4.0.
|
|
94
|
+
"vitest": "^4.0.14",
|
|
95
95
|
{{/if}}
|
|
96
|
-
"rimraf": "^6.0
|
|
96
|
+
"rimraf": "^6.1.0"
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -6,6 +6,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
|
|
|
6
6
|
{{/if}}
|
|
7
7
|
{{#if (includes transports 'sse')}}
|
|
8
8
|
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'
|
|
9
|
+
import { createServer } from '@/services'
|
|
9
10
|
{{/if}}
|
|
10
11
|
{{#if (includes transports 'streamable')}}
|
|
11
12
|
import { generateSessionId } from '@/utils'
|
|
@@ -81,10 +82,16 @@ export async function webServer(server, options) {
|
|
|
81
82
|
const transport = new SSEServerTransport('/messages', res)
|
|
82
83
|
transports.sse[transport.sessionId] = transport
|
|
83
84
|
|
|
85
|
+
const interval = setInterval(() => {
|
|
86
|
+
res.raw.write(`event: ping\ndata: {"time":"${new Date().toISOString()}"}\n\n`)
|
|
87
|
+
}, 15000)
|
|
88
|
+
|
|
84
89
|
res.on('close', () => {
|
|
85
90
|
delete transports.sse[transport.sessionId]
|
|
91
|
+
clearInterval(interval)
|
|
86
92
|
})
|
|
87
93
|
|
|
94
|
+
const server = createServer(options)
|
|
88
95
|
await server.connect(transport)
|
|
89
96
|
})
|
|
90
97
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"prepare": "husky"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
44
|
+
"@modelcontextprotocol/sdk": "^1.21.0",
|
|
45
45
|
"dotenv": "^17.2.3",
|
|
46
46
|
{{#if (or (includes transports 'streamable') (includes transports 'sse'))}}
|
|
47
47
|
"express": "^5.1.0",
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
{{/if}}
|
|
64
64
|
"@types/yargs": "^17.0.34",
|
|
65
65
|
{{#if (includes plugins 'style')}}
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
67
|
-
"@typescript-eslint/parser": "^8.
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
67
|
+
"@typescript-eslint/parser": "^8.48.0",
|
|
68
68
|
{{/if}}
|
|
69
69
|
{{#if (includes plugins 'vitest')}}
|
|
70
|
-
"@vitest/coverage-v8": "^4.0.
|
|
70
|
+
"@vitest/coverage-v8": "^4.0.14",
|
|
71
71
|
"c8": "^10.1.3",
|
|
72
72
|
{{/if}}
|
|
73
73
|
{{#if (includes plugins 'changelog')}}
|
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
"conventional-changelog-cli": "^5.0.0",
|
|
80
80
|
{{/if}}
|
|
81
81
|
"cross-env": "^10.1.0",
|
|
82
|
-
"esbuild": "^0.25.
|
|
82
|
+
"esbuild": "^0.25.12",
|
|
83
83
|
{{#if (includes plugins 'style')}}
|
|
84
|
-
"eslint": "^9.
|
|
84
|
+
"eslint": "^9.39.1",
|
|
85
85
|
"eslint-plugin-import": "^2.32.0",
|
|
86
86
|
"eslint-plugin-prettier": "^5.5.3",
|
|
87
|
-
"globals": "^16.
|
|
87
|
+
"globals": "^16.5.0",
|
|
88
88
|
{{/if}}
|
|
89
89
|
"husky": "^9.1.7",
|
|
90
90
|
{{#if (includes plugins 'style')}}
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"tsx": "^4.20.6",
|
|
103
103
|
"typescript": "^5.9.3",
|
|
104
104
|
{{#if (includes plugins 'vitest')}}
|
|
105
|
-
"vitest": "^4.0.
|
|
105
|
+
"vitest": "^4.0.14",
|
|
106
106
|
{{/if}}
|
|
107
|
-
"rimraf": "^6.0
|
|
107
|
+
"rimraf": "^6.1.0"
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -10,7 +10,7 @@ import { webServer } from './web'
|
|
|
10
10
|
{{/if}}
|
|
11
11
|
import type { OptionsType } from '@/types'
|
|
12
12
|
|
|
13
|
-
const createServer = (options: OptionsType) => {
|
|
13
|
+
export const createServer = (options: OptionsType) => {
|
|
14
14
|
const server = new McpServer({
|
|
15
15
|
name: options.name,
|
|
16
16
|
version: options.version,
|
|
@@ -6,6 +6,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
|
|
|
6
6
|
{{/if}}
|
|
7
7
|
{{#if (includes transports 'sse')}}
|
|
8
8
|
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'
|
|
9
|
+
import { createServer } from '@/services'
|
|
9
10
|
{{/if}}
|
|
10
11
|
{{#if (includes transports 'streamable')}}
|
|
11
12
|
import { generateSessionId } from '@/utils'
|
|
@@ -83,10 +84,16 @@ export async function webServer(server: McpServer, options: OptionsType) {
|
|
|
83
84
|
const transport = new SSEServerTransport('/messages', res)
|
|
84
85
|
transports.sse[transport.sessionId] = transport
|
|
85
86
|
|
|
87
|
+
const interval = setInterval(() => {
|
|
88
|
+
res.raw.write(`event: ping\ndata: {"time":"${new Date().toISOString()}"}\n\n`)
|
|
89
|
+
}, 15000)
|
|
90
|
+
|
|
86
91
|
res.on('close', () => {
|
|
87
92
|
delete transports.sse[transport.sessionId]
|
|
93
|
+
clearInterval(interval)
|
|
88
94
|
})
|
|
89
95
|
|
|
96
|
+
const server = createServer(options)
|
|
90
97
|
await server.connect(transport)
|
|
91
98
|
})
|
|
92
99
|
|