create-mcp-kit 0.0.6 → 0.0.8
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 +242 -50
- package/dist/index.js +21 -24
- package/package.json +8 -3
- package/template/client-js/.env.hbs +0 -0
- package/template/client-js/.gitignore.hbs +112 -0
- package/template/client-js/.nvmrc.hbs +1 -0
- package/template/client-js/.prettierrc.hbs +13 -0
- package/template/client-js/LICENSE.hbs +21 -0
- package/template/client-js/_github/workflows/build.yml.hbs +39 -0
- package/template/client-js/_github/workflows/npm-publish.yml.hbs +41 -0
- package/template/client-js/_husky/commit-msg.hbs +3 -0
- package/template/client-js/_husky/pre-commit.hbs +3 -0
- package/template/client-js/changelog-option.js.hbs +89 -0
- package/template/client-js/commitlint.config.js.hbs +27 -0
- package/template/client-js/eslint.config.js.hbs +48 -0
- package/template/client-js/jsconfig.json.hbs +21 -0
- package/template/client-js/lint-staged.config.js.hbs +5 -0
- package/template/client-js/package.json.hbs +66 -0
- package/template/client-js/scripts/base.js.hbs +65 -0
- package/template/client-js/scripts/build.js.hbs +4 -0
- package/template/client-js/scripts/dev.js.hbs +7 -0
- package/template/client-js/src/index.js.hbs +153 -0
- package/template/client-js/tests/index.test.js.hbs +22 -0
- package/template/{server-js/tests/utils.js → client-js/tests/utils.js.hbs} +2 -0
- package/template/client-js/vitest.config.js.hbs +27 -0
- package/template/client-js/vitest.global.js.hbs +21 -0
- package/template/client-ts/.env.hbs +0 -0
- package/template/client-ts/.gitignore.hbs +112 -0
- package/template/client-ts/.nvmrc.hbs +1 -0
- package/template/client-ts/.prettierrc.hbs +13 -0
- package/template/client-ts/LICENSE.hbs +21 -0
- package/template/client-ts/_github/workflows/build.yml.hbs +39 -0
- package/template/client-ts/_github/workflows/npm-publish.yml.hbs +41 -0
- package/template/client-ts/_husky/commit-msg.hbs +3 -0
- package/template/client-ts/_husky/pre-commit.hbs +3 -0
- package/template/client-ts/changelog-option.js.hbs +89 -0
- package/template/client-ts/commitlint.config.js.hbs +27 -0
- package/template/client-ts/eslint.config.js.hbs +55 -0
- package/template/client-ts/lint-staged.config.js.hbs +5 -0
- package/template/client-ts/package.json.hbs +73 -0
- package/template/client-ts/scripts/base.js.hbs +65 -0
- package/template/client-ts/scripts/build.js.hbs +4 -0
- package/template/client-ts/scripts/dev.js.hbs +7 -0
- package/template/client-ts/src/index.ts.hbs +153 -0
- package/template/client-ts/tests/index.test.ts.hbs +22 -0
- package/template/{server-ts/tests/utils.ts → client-ts/tests/utils.ts.hbs} +2 -0
- package/template/client-ts/tsconfig.json.hbs +21 -0
- package/template/client-ts/vitest.config.ts.hbs +27 -0
- package/template/client-ts/vitest.global.ts.hbs +21 -0
- package/template/server-js/jsconfig.json.hbs +5 -1
- package/template/server-js/package.json.hbs +5 -5
- package/template/server-js/tests/utils.js.hbs +18 -0
- package/template/server-js/vitest.config.js.hbs +5 -0
- package/template/server-js/vitest.global.js.hbs +1 -1
- package/template/server-ts/package.json.hbs +9 -8
- package/template/server-ts/tests/utils.ts.hbs +22 -0
- package/template/server-ts/tsconfig.json.hbs +5 -1
- package/template/server-ts/vitest.config.ts.hbs +5 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Create-MCP-Kit
|
|
2
2
|
A CLI tool to create MCP (Model Context Protocol) applications with ease.
|
|
3
3
|
|
|
4
4
|
[![][npm-release-shield]][npm-release-link]
|
|
@@ -12,6 +12,8 @@ A CLI tool to create MCP (Model Context Protocol) applications with ease.
|
|
|
12
12
|
- 📦 TypeScript support out of the box
|
|
13
13
|
- 🛠️ Built-in development tools
|
|
14
14
|
- 🔧 Configurable project templates
|
|
15
|
+
- 🌐 Multiple Transport Modes (stdio/streamable-http/sse)
|
|
16
|
+
- 📚 Comprehensive APIs
|
|
15
17
|
|
|
16
18
|
## Usage
|
|
17
19
|
|
|
@@ -31,85 +33,275 @@ or
|
|
|
31
33
|
pnpm create mcp-kit@latest
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
## Project
|
|
36
|
+
## Project Types
|
|
37
|
+
|
|
38
|
+
create-mcp-kit supports generating two types of projects:
|
|
39
|
+
|
|
40
|
+
### MCP Server
|
|
41
|
+
|
|
42
|
+
Create an MCP server that provides tools, resources, and prompts for MCP clients.
|
|
43
|
+
|
|
44
|
+
#### Server Project Structure
|
|
35
45
|
|
|
36
46
|
```text
|
|
37
|
-
The generated project will have the following structure:
|
|
47
|
+
The generated server project will have the following structure:
|
|
38
48
|
|
|
39
49
|
├── src/
|
|
40
50
|
│ ├── tools/ # MCP tools implementation
|
|
51
|
+
│ │ ├── index.ts # Tools registration
|
|
52
|
+
│ │ └── register*.ts # Individual tool implementations
|
|
41
53
|
│ ├── resources/ # MCP resources implementation
|
|
54
|
+
│ │ └── index.ts # Resources registration
|
|
42
55
|
│ ├── prompts/ # MCP prompts implementation
|
|
43
|
-
│
|
|
56
|
+
│ │ └── index.ts # Prompts registration
|
|
57
|
+
│ ├── services/ # Server implementations
|
|
58
|
+
│ │ ├── stdio.ts # STDIO transport implementation
|
|
59
|
+
│ │ └── web.ts # Streamable HTTP and SSE transport implementation
|
|
44
60
|
│ └── index.ts # Entry point
|
|
45
|
-
├── tests/ # Test files
|
|
61
|
+
├── tests/ # Test files (optional)
|
|
62
|
+
├── scripts/ # Build and development scripts
|
|
63
|
+
├── .github/ # GitHub Actions workflows (optional)
|
|
64
|
+
├── .husky/ # Git hooks (optional)
|
|
65
|
+
└── package.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### Server Development Scripts
|
|
69
|
+
|
|
70
|
+
- `npm run dev` - Start the development server in stdio mode
|
|
71
|
+
- `npm run dev:web` - Start the development server in web mode
|
|
72
|
+
- `npm run build` - Build the project
|
|
73
|
+
- `npm run test` - Run tests (if vitest plugin is selected)
|
|
74
|
+
- `npm run coverage` - Generate test coverage report (if vitest plugin is selected)
|
|
75
|
+
- `npm run lint` - Run linting (if style plugin is selected)
|
|
76
|
+
|
|
77
|
+
### MCP Client
|
|
78
|
+
|
|
79
|
+
Create an MCP client that connects to MCP servers and uses their tools, resources, and prompts.
|
|
80
|
+
|
|
81
|
+
#### Client Project Structure
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
The generated client project will have the following structure:
|
|
85
|
+
|
|
86
|
+
├── src/
|
|
87
|
+
│ └── index.ts # Entry point with transport implementations
|
|
88
|
+
├── tests/ # Test files (optional)
|
|
46
89
|
├── scripts/ # Build and development scripts
|
|
47
|
-
├── .github/ # GitHub Actions workflows
|
|
90
|
+
├── .github/ # GitHub Actions workflows (optional)
|
|
91
|
+
├── .husky/ # Git hooks (optional)
|
|
48
92
|
└── package.json
|
|
49
93
|
```
|
|
50
94
|
|
|
51
|
-
|
|
95
|
+
#### Client Development Scripts
|
|
52
96
|
|
|
53
|
-
- npm run dev - Start the
|
|
54
|
-
- npm run
|
|
55
|
-
- npm run
|
|
56
|
-
- npm run
|
|
57
|
-
- npm run
|
|
97
|
+
- `npm run dev` - Start the client in development mode
|
|
98
|
+
- `npm run build` - Build the project
|
|
99
|
+
- `npm run test` - Run tests (if vitest plugin is selected)
|
|
100
|
+
- `npm run coverage` - Generate test coverage report (if vitest plugin is selected)
|
|
101
|
+
- `npm run lint` - Run linting (if style plugin is selected)
|
|
58
102
|
|
|
59
103
|
## Features
|
|
60
|
-
|
|
104
|
+
|
|
105
|
+
### MCP Server Features
|
|
106
|
+
|
|
107
|
+
#### Transport Modes
|
|
108
|
+
|
|
109
|
+
MCP Server supports three transport modes:
|
|
110
|
+
|
|
111
|
+
1. **STDIO**: Communication through standard input/output streams
|
|
112
|
+
2. **Streamable HTTP**: RESTful API with streaming capabilities
|
|
113
|
+
3. **SSE (Server-Sent Events)**: Real-time event streaming from server to client
|
|
114
|
+
|
|
115
|
+
#### MCP Tools
|
|
61
116
|
Implement custom tools that can be used by MCP clients:
|
|
62
117
|
|
|
63
118
|
```ts
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
119
|
+
// Full implementation example
|
|
120
|
+
import { z } from 'zod'
|
|
121
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
122
|
+
|
|
123
|
+
export default function register(server, options) {
|
|
124
|
+
server.registerTool(
|
|
125
|
+
'GetData',
|
|
126
|
+
{
|
|
127
|
+
title: 'Get Data',
|
|
128
|
+
description: 'Get Data',
|
|
129
|
+
inputSchema: {
|
|
130
|
+
keyword: z.string().describe('search keyword'),
|
|
131
|
+
},
|
|
71
132
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
133
|
+
async ({ keyword }) => {
|
|
134
|
+
const { success, data, message } = await getData(keyword, options)
|
|
135
|
+
return {
|
|
136
|
+
content: [
|
|
137
|
+
{
|
|
138
|
+
type: 'text',
|
|
139
|
+
text: success ? data : message,
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export const getData = async (keyword, options) => {
|
|
148
|
+
if (!keyword || keyword === 'error') {
|
|
149
|
+
return {
|
|
150
|
+
success: false,
|
|
151
|
+
message: 'Invalid keyword',
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
success: true,
|
|
157
|
+
data: `Data for ${keyword}`,
|
|
75
158
|
}
|
|
76
|
-
|
|
159
|
+
}
|
|
77
160
|
```
|
|
78
|
-
|
|
161
|
+
|
|
162
|
+
#### MCP Resources
|
|
79
163
|
Define resources that can be accessed by MCP clients:
|
|
80
164
|
|
|
81
165
|
```ts
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
166
|
+
// Full implementation example
|
|
167
|
+
import { type McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
168
|
+
import type { OptionsType } from '@/types'
|
|
169
|
+
|
|
170
|
+
export const registerResources = (server: McpServer, options: OptionsType) => {
|
|
171
|
+
server.registerResource(
|
|
172
|
+
'search',
|
|
173
|
+
new ResourceTemplate('search://{keyword}', {
|
|
174
|
+
list: undefined,
|
|
175
|
+
}),
|
|
176
|
+
{
|
|
177
|
+
title: 'Search Resource',
|
|
178
|
+
description: 'Dynamic generate search resource',
|
|
179
|
+
},
|
|
180
|
+
async (uri, { keyword }) => {
|
|
181
|
+
return {
|
|
182
|
+
contents: [
|
|
183
|
+
{
|
|
184
|
+
uri: uri.href,
|
|
185
|
+
text: `search ${keyword}`,
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
)
|
|
191
|
+
}
|
|
95
192
|
```
|
|
96
|
-
|
|
193
|
+
|
|
194
|
+
#### MCP Prompts
|
|
97
195
|
Create reusable prompts for MCP clients:
|
|
98
196
|
|
|
99
197
|
```ts
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
198
|
+
// Full implementation example
|
|
199
|
+
import { z } from 'zod'
|
|
200
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
201
|
+
|
|
202
|
+
export const registerPrompts = (server: McpServer) => {
|
|
203
|
+
server.registerPrompt(
|
|
204
|
+
'echo',
|
|
205
|
+
{
|
|
206
|
+
title: 'Echo Prompt',
|
|
207
|
+
description: 'Creates a prompt to process a message.',
|
|
208
|
+
argsSchema: {
|
|
209
|
+
message: z.string(),
|
|
210
|
+
},
|
|
107
211
|
},
|
|
212
|
+
({ message }) => {
|
|
213
|
+
return {
|
|
214
|
+
messages: [
|
|
215
|
+
{
|
|
216
|
+
role: 'user',
|
|
217
|
+
content: {
|
|
218
|
+
type: 'text',
|
|
219
|
+
text: `Please process this message: ${message}`,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### MCP Client Features
|
|
230
|
+
|
|
231
|
+
#### Multiple Transport Modes
|
|
232
|
+
Connect to MCP servers using different transport modes:
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
// Import the MCP client
|
|
236
|
+
import { McpClient } from '@modelcontextprotocol/sdk/client/mcp.js'
|
|
237
|
+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/transports/stdio.js'
|
|
238
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/transports/streamable-http.js'
|
|
239
|
+
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/transports/sse.js'
|
|
240
|
+
|
|
241
|
+
// Create a new MCP client
|
|
242
|
+
const client = new McpClient()
|
|
243
|
+
|
|
244
|
+
// STDIO Transport
|
|
245
|
+
const stdioClientTransport = new StdioClientTransport({
|
|
246
|
+
command: 'npx',
|
|
247
|
+
args: ['-y', '@my-mcp-hub/node-mcp-server'],
|
|
248
|
+
env: process.env,
|
|
249
|
+
})
|
|
250
|
+
await client.connect(stdioClientTransport)
|
|
251
|
+
|
|
252
|
+
// Streamable HTTP Transport
|
|
253
|
+
const streamableBaseUrl = new URL('http://localhost:8401/mcp')
|
|
254
|
+
const streamableClientTransport = new StreamableHTTPClientTransport(streamableBaseUrl)
|
|
255
|
+
await client.connect(streamableClientTransport)
|
|
256
|
+
|
|
257
|
+
// SSE Transport
|
|
258
|
+
const sseBaseUrl = new URL('http://localhost:8401/sse')
|
|
259
|
+
const sseClientTransport = new SSEClientTransport(sseBaseUrl)
|
|
260
|
+
await client.connect(sseClientTransport)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### Tool Calling
|
|
264
|
+
Call tools provided by MCP servers:
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
// List available tools
|
|
268
|
+
const tools = await client.listTools()
|
|
269
|
+
console.log(tools)
|
|
270
|
+
|
|
271
|
+
// Call a tool
|
|
272
|
+
const callResult = await client.callTool({
|
|
273
|
+
name: 'GetData',
|
|
274
|
+
arguments: {
|
|
275
|
+
keyword: 'Hello',
|
|
108
276
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
277
|
+
})
|
|
278
|
+
console.log(callResult.content)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### Resource Access
|
|
282
|
+
Access resources provided by MCP servers:
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
// List available resources
|
|
286
|
+
const resources = await client.listResources()
|
|
287
|
+
console.log(resources)
|
|
288
|
+
|
|
289
|
+
// Get a resource
|
|
290
|
+
const resource = await client.getResource('search://example')
|
|
291
|
+
console.log(resource.contents)
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
#### Prompt Usage
|
|
295
|
+
Use prompts provided by MCP servers:
|
|
296
|
+
|
|
297
|
+
```ts
|
|
298
|
+
// List available prompts
|
|
299
|
+
const prompts = await client.listPrompts()
|
|
300
|
+
console.log(prompts)
|
|
301
|
+
|
|
302
|
+
// Use a prompt
|
|
303
|
+
const prompt = await client.getPrompt('echo', { message: 'Hello, world!' })
|
|
304
|
+
console.log(prompt.messages)
|
|
113
305
|
```
|
|
114
306
|
|
|
115
307
|
## Contributing
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,10 @@ const group = await clack.group({
|
|
|
32
32
|
message: "Project type:",
|
|
33
33
|
options: [{
|
|
34
34
|
value: "server",
|
|
35
|
-
label: pc.
|
|
35
|
+
label: pc.magentaBright("MCP Server")
|
|
36
|
+
}, {
|
|
37
|
+
value: "client",
|
|
38
|
+
label: pc.greenBright("MCP Client")
|
|
36
39
|
}]
|
|
37
40
|
}),
|
|
38
41
|
name: ({ results }) => clack.text({
|
|
@@ -44,10 +47,10 @@ const group = await clack.group({
|
|
|
44
47
|
message: "Project language:",
|
|
45
48
|
options: [{
|
|
46
49
|
value: "ts",
|
|
47
|
-
label: pc.
|
|
50
|
+
label: pc.magentaBright("TypeScript")
|
|
48
51
|
}, {
|
|
49
52
|
value: "js",
|
|
50
|
-
label: pc.
|
|
53
|
+
label: pc.greenBright("JavaScript")
|
|
51
54
|
}]
|
|
52
55
|
}),
|
|
53
56
|
transports: () => {
|
|
@@ -58,15 +61,15 @@ const group = await clack.group({
|
|
|
58
61
|
options: [
|
|
59
62
|
{
|
|
60
63
|
value: "stdio",
|
|
61
|
-
label: pc.
|
|
64
|
+
label: pc.magentaBright("STDIO")
|
|
62
65
|
},
|
|
63
66
|
{
|
|
64
67
|
value: "streamable",
|
|
65
|
-
label: pc.
|
|
68
|
+
label: pc.greenBright("Streamable HTTP")
|
|
66
69
|
},
|
|
67
70
|
{
|
|
68
71
|
value: "sse",
|
|
69
|
-
label: pc.
|
|
72
|
+
label: pc.yellowBright("SSE")
|
|
70
73
|
}
|
|
71
74
|
]
|
|
72
75
|
});
|
|
@@ -75,17 +78,17 @@ const group = await clack.group({
|
|
|
75
78
|
message: "Project template:",
|
|
76
79
|
options: [{
|
|
77
80
|
value: "standard",
|
|
78
|
-
label: pc.
|
|
81
|
+
label: pc.magentaBright("Standard (recommended)")
|
|
79
82
|
}, {
|
|
80
83
|
value: "custom",
|
|
81
|
-
label: pc.
|
|
84
|
+
label: pc.greenBright("Custom")
|
|
82
85
|
}]
|
|
83
86
|
}),
|
|
84
87
|
plugins: ({ results }) => {
|
|
85
88
|
if (results.template !== "custom") return Promise.resolve([
|
|
86
89
|
"github-action",
|
|
87
90
|
"vitest",
|
|
88
|
-
"inspector",
|
|
91
|
+
...results.type === "server" ? ["inspector"] : [],
|
|
89
92
|
"style",
|
|
90
93
|
"commitlint",
|
|
91
94
|
"changelog"
|
|
@@ -96,23 +99,23 @@ const group = await clack.group({
|
|
|
96
99
|
options: [
|
|
97
100
|
{
|
|
98
101
|
value: "github-action",
|
|
99
|
-
label: pc.
|
|
102
|
+
label: pc.magentaBright("GitHub Action")
|
|
100
103
|
},
|
|
101
104
|
{
|
|
102
105
|
value: "vitest",
|
|
103
|
-
label: pc.
|
|
106
|
+
label: pc.greenBright("Vitest")
|
|
104
107
|
},
|
|
105
|
-
{
|
|
108
|
+
...results.type === "server" ? [{
|
|
106
109
|
value: "inspector",
|
|
107
|
-
label: pc.
|
|
108
|
-
},
|
|
110
|
+
label: pc.cyanBright("Inspector")
|
|
111
|
+
}] : [],
|
|
109
112
|
{
|
|
110
113
|
value: "style",
|
|
111
|
-
label: pc.
|
|
114
|
+
label: pc.yellowBright("ESLint + Prettier + Lint-staged")
|
|
112
115
|
},
|
|
113
116
|
{
|
|
114
117
|
value: "commitlint",
|
|
115
|
-
label: pc.
|
|
118
|
+
label: pc.redBright("Commitlint")
|
|
116
119
|
},
|
|
117
120
|
{
|
|
118
121
|
value: "changelog",
|
|
@@ -137,8 +140,6 @@ if (await fileExists(targetPath)) {
|
|
|
137
140
|
process.exit(1);
|
|
138
141
|
}
|
|
139
142
|
{
|
|
140
|
-
const createSpinner = clack.spinner();
|
|
141
|
-
createSpinner.start("Creating project...");
|
|
142
143
|
await sleep(100);
|
|
143
144
|
try {
|
|
144
145
|
await createProject(targetPath, templatePath, {
|
|
@@ -149,11 +150,9 @@ if (await fileExists(targetPath)) {
|
|
|
149
150
|
components: []
|
|
150
151
|
});
|
|
151
152
|
} catch (error) {
|
|
152
|
-
createSpinner.stop("Failed to create project");
|
|
153
153
|
clack.log.error(error.message);
|
|
154
154
|
process.exit(1);
|
|
155
155
|
}
|
|
156
|
-
createSpinner.stop(pc.green("Project created!"));
|
|
157
156
|
}
|
|
158
157
|
if (group.install) {
|
|
159
158
|
const spinner = clack.spinner();
|
|
@@ -161,14 +160,12 @@ if (group.install) {
|
|
|
161
160
|
await installDependencies(targetPath);
|
|
162
161
|
spinner.stop(pc.green("Dependencies installed!"));
|
|
163
162
|
}
|
|
164
|
-
clack.outro(
|
|
165
|
-
${pc.green("✓")} Project created successfully!
|
|
163
|
+
clack.outro(`${pc.green("✓")} Project created successfully!
|
|
166
164
|
|
|
167
165
|
${pc.cyan("Next steps:")}
|
|
168
166
|
${pc.dim("cd")} ${group.name}
|
|
169
167
|
${group.install ? "" : `${pc.dim("npm install")}\n `}${pc.dim("npm run dev")}
|
|
170
168
|
|
|
171
|
-
Enjoy coding!
|
|
172
|
-
`);
|
|
169
|
+
Enjoy coding! 🎉`);
|
|
173
170
|
|
|
174
171
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mcp-kit",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "A CLI tool to create MCP (Model Context Protocol) applications with ease.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "zhensherlock",
|
|
7
7
|
"homepage": "https://github.com/my-mcp-hub/mcp-kit/tree/master/packages/create#readme",
|
|
@@ -12,11 +12,16 @@
|
|
|
12
12
|
"mcp",
|
|
13
13
|
"mcp server",
|
|
14
14
|
"mcp client",
|
|
15
|
+
"mcp host",
|
|
15
16
|
"mcp kit",
|
|
16
17
|
"mcp tool kit",
|
|
18
|
+
"mcp cli",
|
|
19
|
+
"cli",
|
|
20
|
+
"cli tool",
|
|
17
21
|
"create mcp",
|
|
18
22
|
"create mcp server",
|
|
19
23
|
"create mcp client",
|
|
24
|
+
"create mcp host",
|
|
20
25
|
"modelcontextprotocol",
|
|
21
26
|
"typescript"
|
|
22
27
|
],
|
|
@@ -43,7 +48,7 @@
|
|
|
43
48
|
"gradient-string": "^3.0.0",
|
|
44
49
|
"handlebars": "^4.7.8",
|
|
45
50
|
"picocolors": "^1.1.1",
|
|
46
|
-
"@mcp-tool-kit/shared": "^0.0.
|
|
51
|
+
"@mcp-tool-kit/shared": "^0.0.9"
|
|
47
52
|
},
|
|
48
53
|
"devDependencies": {},
|
|
49
54
|
"scripts": {
|
|
File without changes
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
.idea/
|
|
3
|
+
# Logs
|
|
4
|
+
logs
|
|
5
|
+
*.log
|
|
6
|
+
npm-debug.log*
|
|
7
|
+
yarn-debug.log*
|
|
8
|
+
yarn-error.log*
|
|
9
|
+
lerna-debug.log*
|
|
10
|
+
|
|
11
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
12
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
13
|
+
|
|
14
|
+
# Runtime data
|
|
15
|
+
pids
|
|
16
|
+
*.pid
|
|
17
|
+
*.seed
|
|
18
|
+
*.pid.lock
|
|
19
|
+
|
|
20
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
21
|
+
lib-cov
|
|
22
|
+
|
|
23
|
+
# Coverage directory used by tools like istanbul
|
|
24
|
+
coverage
|
|
25
|
+
*.lcov
|
|
26
|
+
|
|
27
|
+
# nyc test coverage
|
|
28
|
+
.nyc_output
|
|
29
|
+
|
|
30
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
31
|
+
.grunt
|
|
32
|
+
|
|
33
|
+
# Bower dependency directory (https://bower.io/)
|
|
34
|
+
bower_components
|
|
35
|
+
|
|
36
|
+
# node-waf configuration
|
|
37
|
+
.lock-wscript
|
|
38
|
+
|
|
39
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
40
|
+
build/Release
|
|
41
|
+
|
|
42
|
+
# Dependency directories
|
|
43
|
+
node_modules/
|
|
44
|
+
jspm_packages/
|
|
45
|
+
|
|
46
|
+
# TypeScript v1 declaration files
|
|
47
|
+
typings/
|
|
48
|
+
|
|
49
|
+
# TypeScript cache
|
|
50
|
+
*.tsbuildinfo
|
|
51
|
+
|
|
52
|
+
# Optional npm cache directory
|
|
53
|
+
.npm
|
|
54
|
+
|
|
55
|
+
# Optional eslint cache
|
|
56
|
+
.eslintcache
|
|
57
|
+
|
|
58
|
+
# Microbundle cache
|
|
59
|
+
.rpt2_cache/
|
|
60
|
+
.rts2_cache_cjs/
|
|
61
|
+
.rts2_cache_es/
|
|
62
|
+
.rts2_cache_umd/
|
|
63
|
+
|
|
64
|
+
# Optional REPL history
|
|
65
|
+
.node_repl_history
|
|
66
|
+
|
|
67
|
+
# Output of 'npm pack'
|
|
68
|
+
*.tgz
|
|
69
|
+
|
|
70
|
+
# Yarn Integrity file
|
|
71
|
+
.yarn-integrity
|
|
72
|
+
|
|
73
|
+
# dotenv environment variables file
|
|
74
|
+
#.env
|
|
75
|
+
.env.test
|
|
76
|
+
|
|
77
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
78
|
+
.cache
|
|
79
|
+
|
|
80
|
+
# Next.js build output
|
|
81
|
+
.next
|
|
82
|
+
|
|
83
|
+
# Nuxt.js build / generate output
|
|
84
|
+
.nuxt
|
|
85
|
+
dist
|
|
86
|
+
|
|
87
|
+
# Gatsby files
|
|
88
|
+
.cache/
|
|
89
|
+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
|
90
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
91
|
+
# public
|
|
92
|
+
|
|
93
|
+
# vuepress build output
|
|
94
|
+
.vuepress/dist
|
|
95
|
+
|
|
96
|
+
# Serverless directories
|
|
97
|
+
.serverless/
|
|
98
|
+
|
|
99
|
+
# FuseBox cache
|
|
100
|
+
.fusebox/
|
|
101
|
+
|
|
102
|
+
# DynamoDB Local files
|
|
103
|
+
.dynamodb/
|
|
104
|
+
|
|
105
|
+
# TernJS port file
|
|
106
|
+
.tern-port
|
|
107
|
+
|
|
108
|
+
/docs/.vitepress/cache/
|
|
109
|
+
|
|
110
|
+
stats.html
|
|
111
|
+
|
|
112
|
+
build/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v22
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{#if (includes plugins 'style')}}
|
|
2
|
+
{
|
|
3
|
+
"tabWidth": 2,
|
|
4
|
+
"printWidth": 120,
|
|
5
|
+
"useTabs": false,
|
|
6
|
+
"semi": false,
|
|
7
|
+
"singleQuote": true,
|
|
8
|
+
"trailingComma": "all",
|
|
9
|
+
"bracketSpacing": true,
|
|
10
|
+
"jsxBracketSameLine": false,
|
|
11
|
+
"arrowParens": "avoid"
|
|
12
|
+
}
|
|
13
|
+
{{/if}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) {{year}} {{projectName}}
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{{#if (includes plugins 'github-action')}}
|
|
2
|
+
name: build
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
if: github.repository == '{{projectName}}'
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: Install Node
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: 22
|
|
23
|
+
cache: npm
|
|
24
|
+
|
|
25
|
+
- name: Install Package
|
|
26
|
+
run: npm i
|
|
27
|
+
|
|
28
|
+
- name: Lint
|
|
29
|
+
run: npm run lint
|
|
30
|
+
|
|
31
|
+
- name: Build Package
|
|
32
|
+
run: npm run build
|
|
33
|
+
|
|
34
|
+
- name: Test Package
|
|
35
|
+
run: npm run coverage
|
|
36
|
+
|
|
37
|
+
- name: Coveralls
|
|
38
|
+
uses: coverallsapp/github-action@v2
|
|
39
|
+
{{/if}}
|