create-mcp-use-app 2.0.9-canary.0 → 2.0.9

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.
Files changed (2) hide show
  1. package/README.md +73 -55
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -39,6 +39,7 @@ Create a new MCP application in seconds:
39
39
  ```bash
40
40
  npx create-mcp-use-app my-mcp-server
41
41
  cd my-mcp-server
42
+ npm run dev
42
43
  ```
43
44
 
44
45
  That's it! Your MCP server is running at `http://localhost:3000` with the inspector automatically opened in your browser.
@@ -59,7 +60,7 @@ my-mcp-server/
59
60
  ├── mcp-env.d.ts # Managed view typing bridge
60
61
  ├── public/ # Static assets
61
62
  └── views/ # Included by the mcp-apps template
62
- └── product-search-result/
63
+ └── my-view/
63
64
  └── view.tsx # React view entry point
64
65
  ```
65
66
 
@@ -109,7 +110,7 @@ npx create-mcp-use-app my-project
109
110
  ```bash
110
111
  # Use a specific template
111
112
  npx create-mcp-use-app my-project --template mcp-apps
112
- npx create-mcp-use-app my-project --template mcp-ui
113
+ npx create-mcp-use-app my-project --template mcp-server
113
114
 
114
115
  # Use a GitHub repository as a template
115
116
  npx create-mcp-use-app my-project --template owner/repo
@@ -159,16 +160,14 @@ The mcp-apps template includes:
159
160
 
160
161
  Ideal for building MCP servers that integrate with OpenAI's Apps SDK.
161
162
 
162
- ### MCP-UI Template
163
+ ### Blank Template
163
164
 
164
- The mcp-ui template includes:
165
+ The `blank` template includes:
165
166
 
166
- - MCP server setup focused on MCP-UI resources
167
- - Interactive UI components example
168
- - Kanban board widget demonstration
169
- - Clean, focused setup for UI-first applications
167
+ - An `MCPServer` with no tools, resources, or prompts registered
168
+ - Development and production scripts
170
169
 
171
- Best for building MCP servers with rich interactive UI components.
170
+ Ideal for starting from an empty server and adding your own tools.
172
171
 
173
172
  ### GitHub Repository Templates
174
173
 
@@ -244,7 +243,7 @@ This will:
244
243
  npm run build
245
244
  ```
246
245
 
247
- Creates an optimized build in the `dist/` directory.
246
+ Creates an optimized build in the `.mcp-use/build/` directory.
248
247
 
249
248
  ### Start Production Server
250
249
 
@@ -364,22 +363,11 @@ const result = await agent.run("Use my MCP tools");
364
363
 
365
364
  ### Environment Variables
366
365
 
367
- The created project includes a `.env.example` file:
366
+ `mcp-use dev` and `mcp-use start` load a `.env` file from the project root if one exists. The server listens on `PORT` (default `3000`) and binds to `HOST` (default `127.0.0.1`):
368
367
 
369
368
  ```bash
370
- # Server Configuration
371
369
  PORT=3000
372
- NODE_ENV=development
373
-
374
- # Observability (optional)
375
- LANGFUSE_PUBLIC_KEY=your_public_key
376
- LANGFUSE_SECRET_KEY=your_secret_key
377
- ```
378
-
379
- Copy to `.env` and configure as needed:
380
-
381
- ```bash
382
- cp .env.example .env
370
+ HOST=127.0.0.1
383
371
  ```
384
372
 
385
373
  ### TypeScript Configuration
@@ -389,13 +377,18 @@ The `tsconfig.json` is pre-configured for MCP development:
389
377
  ```json
390
378
  {
391
379
  "compilerOptions": {
392
- "target": "ES2020",
393
- "module": "ESNext",
380
+ "target": "ES2024",
394
381
  "jsx": "react-jsx",
382
+ "module": "NodeNext",
383
+ "moduleResolution": "NodeNext",
384
+ "lib": ["ES2024", "DOM", "DOM.Iterable"],
385
+ "types": ["node"],
395
386
  "strict": true,
396
387
  "esModuleInterop": true,
388
+ "forceConsistentCasingInFileNames": true,
397
389
  "skipLibCheck": true,
398
- "forceConsistentCasingInFileNames": true
390
+ "noEmit": true,
391
+ "noUncheckedSideEffectImports": true
399
392
  }
400
393
  }
401
394
  ```
@@ -407,49 +400,74 @@ The `tsconfig.json` is pre-configured for MCP development:
407
400
  ### Creating a Tool
408
401
 
409
402
  ```typescript
410
- server.tool("search_database", {
411
- description: "Search for records in the database",
412
- parameters: z.object({
413
- query: z.string().describe("Search query"),
414
- limit: z.number().optional().default(10),
415
- }),
416
- execute: async ({ query, limit }) => {
403
+ server.tool(
404
+ {
405
+ name: "search_database",
406
+ description: "Search for records in the database",
407
+ inputSchema: z.object({
408
+ query: z.string().describe("Search query"),
409
+ limit: z.number().optional().default(10),
410
+ }),
411
+ },
412
+ async ({ query, limit }) => {
417
413
  // Your tool logic here
418
414
  const results = await db.search(query, limit);
419
- return { results };
420
- },
421
- });
415
+ return {
416
+ content: [{ type: "text", text: JSON.stringify(results) }],
417
+ };
418
+ }
419
+ );
422
420
  ```
423
421
 
424
422
  ### Creating a Resource
425
423
 
426
424
  ```typescript
427
- server.resource("user_profile", {
428
- description: "Current user profile data",
429
- uri: "user://profile",
430
- mimeType: "application/json",
431
- fetch: async () => {
432
- const profile = await getUserProfile();
433
- return JSON.stringify(profile);
425
+ server.resource(
426
+ {
427
+ name: "user_profile",
428
+ uri: "user://profile",
429
+ description: "Current user profile data",
430
+ mimeType: "application/json",
434
431
  },
435
- });
432
+ async (uri) => {
433
+ const profile = await getUserProfile();
434
+ return {
435
+ contents: [
436
+ {
437
+ uri: uri.href,
438
+ mimeType: "application/json",
439
+ text: JSON.stringify(profile),
440
+ },
441
+ ],
442
+ };
443
+ }
444
+ );
436
445
  ```
437
446
 
438
447
  ### Creating a Prompt
439
448
 
440
449
  ```typescript
441
- server.prompt("code_review", {
442
- description: "Review code for best practices",
443
- arguments: [
444
- { name: "code", description: "Code to review", required: true },
445
- { name: "language", description: "Programming language", required: false },
446
- ],
447
- render: async ({ code, language }) => {
448
- return `Please review this ${
449
- language || ""
450
- } code for best practices:\n\n${code}`;
450
+ server.prompt(
451
+ {
452
+ name: "code_review",
453
+ description: "Review code for best practices",
454
+ schema: z.object({
455
+ code: z.string().describe("Code to review"),
456
+ language: z.string().optional().describe("Programming language"),
457
+ }),
451
458
  },
452
- });
459
+ async ({ code, language }) => ({
460
+ messages: [
461
+ {
462
+ role: "user",
463
+ content: {
464
+ type: "text",
465
+ text: `Please review this ${language ?? ""} code for best practices:\n\n${code}`,
466
+ },
467
+ },
468
+ ],
469
+ })
470
+ );
453
471
  ```
454
472
 
455
473
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mcp-use-app",
3
- "version": "2.0.9-canary.0",
3
+ "version": "2.0.9",
4
4
  "type": "module",
5
5
  "description": "Create MCP-Use apps with one command",
6
6
  "author": "mcp-use, Inc.",