create-mcp-use-app 0.4.0 → 0.4.1-canary.0
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 +43 -29
- package/dist/index.js +3 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</picture>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
<h1 align="center">Create
|
|
9
|
+
<h1 align="center">Create mcp-use App</h1>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/create-mcp-use-app" alt="NPM Downloads">
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
<img src="https://dcbadge.limes.pink/api/server/XkNkSkMz3V?style=flat" /></a>
|
|
22
22
|
</p>
|
|
23
23
|
|
|
24
|
-
🚀 **Create
|
|
24
|
+
🚀 **Create mcp-use App** is the fastest way to scaffold a new MCP (Model Context Protocol) application. With just one command, you get a fully configured TypeScript project with hot reload, automatic inspector, and UI widget support - everything you need to build powerful MCP servers.
|
|
25
25
|
|
|
26
26
|
## 📦 Related Packages
|
|
27
27
|
|
|
28
|
-
| Package
|
|
29
|
-
|
|
30
|
-
| [mcp-use](https://github.com/mcp-use/mcp-use-ts/tree/main/packages/mcp-use)
|
|
31
|
-
| [@mcp-use/cli](https://github.com/mcp-use/mcp-use-ts/tree/main/packages/cli)
|
|
28
|
+
| Package | Description | Version |
|
|
29
|
+
| ---------------------------------------------------------------------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| [mcp-use](https://github.com/mcp-use/mcp-use-ts/tree/main/packages/mcp-use) | Core MCP framework | [](https://www.npmjs.com/package/mcp-use) |
|
|
31
|
+
| [@mcp-use/cli](https://github.com/mcp-use/mcp-use-ts/tree/main/packages/cli) | Build tool for MCP apps | [](https://www.npmjs.com/package/@mcp-use/cli) |
|
|
32
32
|
| [@mcp-use/inspector](https://github.com/mcp-use/mcp-use-ts/tree/main/packages/inspector) | Web-based MCP inspector | [](https://www.npmjs.com/package/@mcp-use/inspector) |
|
|
33
33
|
|
|
34
34
|
---
|
|
@@ -69,15 +69,15 @@ my-mcp-server/
|
|
|
69
69
|
|
|
70
70
|
### Pre-configured Features
|
|
71
71
|
|
|
72
|
-
| Feature
|
|
73
|
-
|
|
74
|
-
| **📝 TypeScript**
|
|
75
|
-
| **🔥 Hot Reload**
|
|
76
|
-
| **🔍 Auto Inspector**
|
|
77
|
-
| **🎨 UI Widgets**
|
|
78
|
-
| **🛠️ Example Tools**
|
|
79
|
-
| **📦 Build Scripts**
|
|
80
|
-
| **🚀 Production Ready** | Optimized build configuration
|
|
72
|
+
| Feature | Description |
|
|
73
|
+
| ----------------------- | ------------------------------------------------- |
|
|
74
|
+
| **📝 TypeScript** | Full TypeScript setup with proper types |
|
|
75
|
+
| **🔥 Hot Reload** | Auto-restart on code changes during development |
|
|
76
|
+
| **🔍 Auto Inspector** | Inspector UI opens automatically in dev mode |
|
|
77
|
+
| **🎨 UI Widgets** | React components that compile to standalone pages |
|
|
78
|
+
| **🛠️ Example Tools** | Sample MCP tools, resources, and prompts |
|
|
79
|
+
| **📦 Build Scripts** | Ready-to-use development and production scripts |
|
|
80
|
+
| **🚀 Production Ready** | Optimized build configuration |
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
@@ -92,6 +92,7 @@ npx create-mcp-use-app
|
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
You'll be prompted for:
|
|
95
|
+
|
|
95
96
|
- Project name
|
|
96
97
|
- Project template
|
|
97
98
|
- Package manager preference
|
|
@@ -126,6 +127,7 @@ npx create-mcp-use-app my-project --skip-install
|
|
|
126
127
|
### Basic Template (Default)
|
|
127
128
|
|
|
128
129
|
The basic template includes:
|
|
130
|
+
|
|
129
131
|
- Simple MCP server setup
|
|
130
132
|
- Example tool, resource, and prompt
|
|
131
133
|
- Basic UI widget example
|
|
@@ -136,6 +138,7 @@ Perfect for getting started quickly or building simple MCP servers.
|
|
|
136
138
|
### Advanced Template
|
|
137
139
|
|
|
138
140
|
The advanced template includes everything from basic plus:
|
|
141
|
+
|
|
139
142
|
- Multiple tools with complex schemas
|
|
140
143
|
- OAuth authentication example
|
|
141
144
|
- Database integration patterns
|
|
@@ -149,6 +152,7 @@ Ideal for production applications or complex integrations.
|
|
|
149
152
|
### Minimal Template
|
|
150
153
|
|
|
151
154
|
The minimal template includes:
|
|
155
|
+
|
|
152
156
|
- Bare-bones MCP server
|
|
153
157
|
- No example tools or widgets
|
|
154
158
|
- Essential configuration only
|
|
@@ -162,16 +166,19 @@ Best for experienced developers who want full control.
|
|
|
162
166
|
The scaffolded project includes these dependencies:
|
|
163
167
|
|
|
164
168
|
### Core Dependencies
|
|
169
|
+
|
|
165
170
|
- `mcp-use` - The MCP framework
|
|
166
171
|
- `@mcp-use/cli` - Build and development tool
|
|
167
172
|
- `@mcp-use/inspector` - Web-based debugger
|
|
168
173
|
|
|
169
174
|
### Development Dependencies
|
|
175
|
+
|
|
170
176
|
- `typescript` - TypeScript compiler
|
|
171
177
|
- `tsx` - TypeScript executor for development
|
|
172
178
|
- `@types/node` - Node.js type definitions
|
|
173
179
|
|
|
174
180
|
### Optional Dependencies (Advanced Template)
|
|
181
|
+
|
|
175
182
|
- Database drivers (PostgreSQL, SQLite)
|
|
176
183
|
- Authentication libraries
|
|
177
184
|
- Monitoring tools
|
|
@@ -193,6 +200,7 @@ pnpm dev
|
|
|
193
200
|
```
|
|
194
201
|
|
|
195
202
|
This will:
|
|
203
|
+
|
|
196
204
|
1. Start the MCP server on port 3000
|
|
197
205
|
2. Open the inspector in your browser
|
|
198
206
|
3. Watch for file changes and auto-reload
|
|
@@ -222,6 +230,7 @@ After creating your app, here's what to do next:
|
|
|
222
230
|
### 1. Explore the Example Server
|
|
223
231
|
|
|
224
232
|
Open `src/index.ts` to see how to:
|
|
233
|
+
|
|
225
234
|
- Define MCP tools with Zod schemas
|
|
226
235
|
- Create resources for data access
|
|
227
236
|
- Set up prompts for AI interactions
|
|
@@ -229,6 +238,7 @@ Open `src/index.ts` to see how to:
|
|
|
229
238
|
### 2. Try the Inspector
|
|
230
239
|
|
|
231
240
|
The inspector automatically opens at `http://localhost:3000/inspector` where you can:
|
|
241
|
+
|
|
232
242
|
- Test your tools interactively
|
|
233
243
|
- View available resources
|
|
234
244
|
- Debug tool executions
|
|
@@ -247,16 +257,14 @@ export default function MyWidget() {
|
|
|
247
257
|
|
|
248
258
|
const handleClick = async () => {
|
|
249
259
|
const result = await callTool('my_tool', {
|
|
250
|
-
param: 'value'
|
|
260
|
+
param: 'value',
|
|
251
261
|
})
|
|
252
262
|
console.log(result)
|
|
253
263
|
}
|
|
254
264
|
|
|
255
265
|
return (
|
|
256
266
|
<div>
|
|
257
|
-
<button onClick={handleClick}>
|
|
258
|
-
Call MCP Tool
|
|
259
|
-
</button>
|
|
267
|
+
<button onClick={handleClick}>Call MCP Tool</button>
|
|
260
268
|
</div>
|
|
261
269
|
)
|
|
262
270
|
}
|
|
@@ -271,12 +279,12 @@ import { MCPClient, MCPAgent } from 'mcp-use'
|
|
|
271
279
|
import { ChatOpenAI } from '@langchain/openai'
|
|
272
280
|
|
|
273
281
|
const client = new MCPClient({
|
|
274
|
-
url: 'http://localhost:3000/mcp'
|
|
282
|
+
url: 'http://localhost:3000/mcp',
|
|
275
283
|
})
|
|
276
284
|
|
|
277
285
|
const agent = new MCPAgent({
|
|
278
286
|
llm: new ChatOpenAI(),
|
|
279
|
-
client
|
|
287
|
+
client,
|
|
280
288
|
})
|
|
281
289
|
|
|
282
290
|
const result = await agent.run('Use my MCP tools')
|
|
@@ -342,13 +350,13 @@ server.tool('search_database', {
|
|
|
342
350
|
description: 'Search for records in the database',
|
|
343
351
|
parameters: z.object({
|
|
344
352
|
query: z.string().describe('Search query'),
|
|
345
|
-
limit: z.number().optional().default(10)
|
|
353
|
+
limit: z.number().optional().default(10),
|
|
346
354
|
}),
|
|
347
355
|
execute: async ({ query, limit }) => {
|
|
348
356
|
// Your tool logic here
|
|
349
357
|
const results = await db.search(query, limit)
|
|
350
358
|
return { results }
|
|
351
|
-
}
|
|
359
|
+
},
|
|
352
360
|
})
|
|
353
361
|
```
|
|
354
362
|
|
|
@@ -362,7 +370,7 @@ server.resource('user_profile', {
|
|
|
362
370
|
fetch: async () => {
|
|
363
371
|
const profile = await getUserProfile()
|
|
364
372
|
return JSON.stringify(profile)
|
|
365
|
-
}
|
|
373
|
+
},
|
|
366
374
|
})
|
|
367
375
|
```
|
|
368
376
|
|
|
@@ -373,11 +381,13 @@ server.prompt('code_review', {
|
|
|
373
381
|
description: 'Review code for best practices',
|
|
374
382
|
arguments: [
|
|
375
383
|
{ name: 'code', description: 'Code to review', required: true },
|
|
376
|
-
{ name: 'language', description: 'Programming language', required: false }
|
|
384
|
+
{ name: 'language', description: 'Programming language', required: false },
|
|
377
385
|
],
|
|
378
386
|
render: async ({ code, language }) => {
|
|
379
|
-
return `Please review this ${
|
|
380
|
-
|
|
387
|
+
return `Please review this ${
|
|
388
|
+
language || ''
|
|
389
|
+
} code for best practices:\n\n${code}`
|
|
390
|
+
},
|
|
381
391
|
})
|
|
382
392
|
```
|
|
383
393
|
|
|
@@ -388,6 +398,7 @@ server.prompt('code_review', {
|
|
|
388
398
|
### Common Issues
|
|
389
399
|
|
|
390
400
|
**Command not found:**
|
|
401
|
+
|
|
391
402
|
```bash
|
|
392
403
|
# Make sure you have Node.js 18+ installed
|
|
393
404
|
node --version
|
|
@@ -397,18 +408,21 @@ npx create-mcp-use-app@latest
|
|
|
397
408
|
```
|
|
398
409
|
|
|
399
410
|
**Permission denied:**
|
|
411
|
+
|
|
400
412
|
```bash
|
|
401
413
|
# On macOS/Linux, you might need sudo
|
|
402
414
|
sudo npx create-mcp-use-app my-app
|
|
403
415
|
```
|
|
404
416
|
|
|
405
417
|
**Network issues:**
|
|
418
|
+
|
|
406
419
|
```bash
|
|
407
420
|
# Use a different registry
|
|
408
421
|
npm config set registry https://registry.npmjs.org/
|
|
409
422
|
```
|
|
410
423
|
|
|
411
424
|
**Port already in use:**
|
|
425
|
+
|
|
412
426
|
```bash
|
|
413
427
|
# Change the port in your .env file
|
|
414
428
|
PORT=3001
|
|
@@ -431,7 +445,7 @@ See our [contributing guide](https://github.com/mcp-use/mcp-use-ts/blob/main/CON
|
|
|
431
445
|
|
|
432
446
|
## 📚 Learn More
|
|
433
447
|
|
|
434
|
-
- [
|
|
448
|
+
- [mcp-use Documentation](https://github.com/mcp-use/mcp-use-ts)
|
|
435
449
|
- [Model Context Protocol Spec](https://modelcontextprotocol.io)
|
|
436
450
|
- [Creating MCP Tools](https://github.com/mcp-use/mcp-use-ts/tree/main/packages/mcp-use#-mcp-server-framework)
|
|
437
451
|
- [Building UI Widgets](https://github.com/mcp-use/mcp-use-ts/tree/main/packages/cli#-creating-ui-widgets)
|
|
@@ -441,4 +455,4 @@ See our [contributing guide](https://github.com/mcp-use/mcp-use-ts/blob/main/CON
|
|
|
441
455
|
|
|
442
456
|
## 📜 License
|
|
443
457
|
|
|
444
|
-
MIT © [
|
|
458
|
+
MIT © [mcp-use](https://github.com/mcp-use)
|
package/dist/index.js
CHANGED
|
@@ -63,18 +63,9 @@ function getCurrentPackageVersions() {
|
|
|
63
63
|
if (!workspaceRoot) {
|
|
64
64
|
throw new Error("Workspace root not found");
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
versions["mcp-use"] = mcpUsePackage.version;
|
|
70
|
-
const cliPackage = JSON.parse(
|
|
71
|
-
readFileSync(join(workspaceRoot, "packages/cli/package.json"), "utf-8")
|
|
72
|
-
);
|
|
73
|
-
versions["@mcp-use/cli"] = cliPackage.version;
|
|
74
|
-
const inspectorPackage = JSON.parse(
|
|
75
|
-
readFileSync(join(workspaceRoot, "packages/inspector/package.json"), "utf-8")
|
|
76
|
-
);
|
|
77
|
-
versions["@mcp-use/inspector"] = inspectorPackage.version;
|
|
66
|
+
versions["mcp-use"] = "latest";
|
|
67
|
+
versions["@mcp-use/cli"] = "latest";
|
|
68
|
+
versions["@mcp-use/inspector"] = "latest";
|
|
78
69
|
} catch (error) {
|
|
79
70
|
if (process.env.NODE_ENV === "development") {
|
|
80
71
|
console.warn("\u26A0\uFE0F Could not read workspace package versions, using defaults");
|