create-mcp-kit 0.0.11 → 0.0.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mcp-kit",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
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.0.12"
51
+ "@mcp-tool-kit/shared": "^0.0.13"
52
52
  },
53
53
  "devDependencies": {},
54
54
  "scripts": {
@@ -46,7 +46,7 @@
46
46
  "conventional-changelog-cli": "^5.0.0",
47
47
  {{/if}}
48
48
  "cross-env": "^10.0.0",
49
- "esbuild": "^0.25.9",
49
+ "esbuild": "^0.25.10",
50
50
  {{#if (includes plugins 'style')}}
51
51
  "eslint": "^9.35.0",
52
52
  "eslint-plugin-import": "^2.32.0",
@@ -36,8 +36,8 @@
36
36
  "@commitlint/config-conventional": "^19.8.1",
37
37
  {{/if}}
38
38
  {{#if (includes plugins 'style')}}
39
- "@typescript-eslint/eslint-plugin": "^8.43.0",
40
- "@typescript-eslint/parser": "^8.43.0",
39
+ "@typescript-eslint/eslint-plugin": "^8.44.0",
40
+ "@typescript-eslint/parser": "^8.44.0",
41
41
  {{/if}}
42
42
  {{#if (includes plugins 'vitest')}}
43
43
  "@vitest/coverage-v8": "^3.2.4",
@@ -51,7 +51,7 @@
51
51
  "conventional-changelog-cli": "^5.0.0",
52
52
  {{/if}}
53
53
  "cross-env": "^10.0.0",
54
- "esbuild": "^0.25.9",
54
+ "esbuild": "^0.25.10",
55
55
  {{#if (includes plugins 'style')}}
56
56
  "eslint": "^9.35.0",
57
57
  "eslint-plugin-import": "^2.32.0",
@@ -70,7 +70,7 @@
70
70
  "conventional-changelog-cli": "^5.0.0",
71
71
  {{/if}}
72
72
  "cross-env": "^10.0.0",
73
- "esbuild": "^0.25.9",
73
+ "esbuild": "^0.25.10",
74
74
  {{#if (includes plugins 'style')}}
75
75
  "eslint": "^9.35.0",
76
76
  "eslint-plugin-import": "^2.32.0",
@@ -1,7 +1,4 @@
1
1
  {{#if (or (includes transports 'streamable') (includes transports 'sse'))}}
2
- {{#if (includes transports 'streamable')}}
3
- import { nanoid } from 'nanoid'
4
- {{/if}}
5
2
  import express from 'express'
6
3
  {{#if (includes transports 'streamable')}}
7
4
  import { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js'
@@ -10,6 +7,9 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
10
7
  {{#if (includes transports 'sse')}}
11
8
  import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'
12
9
  {{/if}}
10
+ {{#if (includes transports 'streamable')}}
11
+ import { generateSessionId } from '@/utils'
12
+ {{/if}}
13
13
 
14
14
  export async function webServer(server, options) {
15
15
  const app = express()
@@ -33,7 +33,7 @@ export async function webServer(server, options) {
33
33
  transport = transports.streamable[sessionId]
34
34
  } else if (!sessionId && isInitializeRequest(req.body)) {
35
35
  transport = new StreamableHTTPServerTransport({
36
- sessionIdGenerator: () => nanoid(),
36
+ sessionIdGenerator: () => generateSessionId(),
37
37
  onsessioninitialized: sessionId => {
38
38
  transports.streamable[sessionId] = transport
39
39
  },
@@ -1,3 +1,9 @@
1
+ import { nanoid } from 'nanoid'
2
+
3
+ export function generateSessionId() {
4
+ return nanoid()
5
+ }
6
+
1
7
  export function getOptions(argv, pkg) {
2
8
  return {
3
9
  name: pkg.name,
@@ -63,8 +63,8 @@
63
63
  {{/if}}
64
64
  "@types/yargs": "^17.0.33",
65
65
  {{#if (includes plugins 'style')}}
66
- "@typescript-eslint/eslint-plugin": "^8.43.0",
67
- "@typescript-eslint/parser": "^8.43.0",
66
+ "@typescript-eslint/eslint-plugin": "^8.44.0",
67
+ "@typescript-eslint/parser": "^8.44.0",
68
68
  {{/if}}
69
69
  {{#if (includes plugins 'vitest')}}
70
70
  "@vitest/coverage-v8": "^3.2.4",
@@ -79,7 +79,7 @@
79
79
  "conventional-changelog-cli": "^5.0.0",
80
80
  {{/if}}
81
81
  "cross-env": "^10.0.0",
82
- "esbuild": "^0.25.9",
82
+ "esbuild": "^0.25.10",
83
83
  {{#if (includes plugins 'style')}}
84
84
  "eslint": "^9.35.0",
85
85
  "eslint-plugin-import": "^2.32.0",
@@ -1,7 +1,4 @@
1
1
  {{#if (or (includes transports 'streamable') (includes transports 'sse'))}}
2
- {{#if (includes transports 'streamable')}}
3
- import { nanoid } from 'nanoid'
4
- {{/if}}
5
2
  import express from 'express'
6
3
  {{#if (includes transports 'streamable')}}
7
4
  import { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js'
@@ -10,6 +7,9 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
10
7
  {{#if (includes transports 'sse')}}
11
8
  import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'
12
9
  {{/if}}
10
+ {{#if (includes transports 'streamable')}}
11
+ import { generateSessionId } from '@/utils'
12
+ {{/if}}
13
13
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
14
14
  import type { OptionsType } from '@/types'
15
15
 
@@ -35,7 +35,7 @@ export async function webServer(server: McpServer, options: OptionsType) {
35
35
  transport = transports.streamable[sessionId]
36
36
  } else if (!sessionId && isInitializeRequest(req.body)) {
37
37
  transport = new StreamableHTTPServerTransport({
38
- sessionIdGenerator: () => nanoid(),
38
+ sessionIdGenerator: () => generateSessionId(),
39
39
  onsessioninitialized: sessionId => {
40
40
  transports.streamable[sessionId] = transport
41
41
  },
@@ -1,6 +1,11 @@
1
+ import { nanoid } from 'nanoid'
1
2
  import type { ArgumentsCamelCase } from 'yargs'
2
3
  import type { OptionsType } from '@/types'
3
4
 
5
+ export function generateSessionId() {
6
+ return nanoid()
7
+ }
8
+
4
9
  export function getOptions(
5
10
  argv: ArgumentsCamelCase,
6
11
  pkg: {