create-mcp-use-app 0.8.0-canary.1 → 0.8.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/dist/index.js CHANGED
@@ -288,6 +288,13 @@ program.name("create-mcp-use-app").description("Create a new MCP server project"
288
288
  listTemplates();
289
289
  process.exit(0);
290
290
  }
291
+ if (options.dev && options.canary) {
292
+ console.error(chalk.red("\u274C Cannot use --dev and --canary together"));
293
+ console.error(
294
+ chalk.yellow(" Please choose only one dependency mode")
295
+ );
296
+ process.exit(1);
297
+ }
291
298
  let selectedTemplate = options.template;
292
299
  if (!projectName) {
293
300
  console.log("");
@@ -47,11 +47,13 @@ server.get("/api/fruits", (c) => {
47
47
  });
48
48
 
49
49
  // Brand Info Tool - Returns brand information
50
- server.tool({
51
- name: "get-brand-info",
52
- description:
53
- "Get information about the brand, including company details, mission, and values",
54
- cb: async () => {
50
+ server.tool(
51
+ {
52
+ name: "get-brand-info",
53
+ description:
54
+ "Get information about the brand, including company details, mission, and values",
55
+ },
56
+ async () => {
55
57
  return {
56
58
  content: [
57
59
  {
@@ -91,8 +93,8 @@ server.tool({
91
93
  },
92
94
  ],
93
95
  };
94
- },
95
- });
96
+ }
97
+ );
96
98
 
97
99
  server.listen().then(() => {
98
100
  console.log(`Server running`);
@@ -256,10 +256,12 @@ root.appendChild(container);
256
256
  * You can mix UIResources with traditional MCP tools and resources
257
257
  */
258
258
 
259
- server.tool({
260
- name: "get-widget-info",
261
- description: "Get information about available UI widgets",
262
- cb: async () => {
259
+ server.tool(
260
+ {
261
+ name: "get-widget-info",
262
+ description: "Get information about available UI widgets",
263
+ },
264
+ async () => {
263
265
  const widgets = [
264
266
  {
265
267
  name: "kanban-board",
@@ -303,8 +305,8 @@ server.tool({
303
305
  },
304
306
  ],
305
307
  };
306
- },
307
- });
308
+ }
309
+ );
308
310
 
309
311
  server.resource({
310
312
  name: "server-config",
@@ -28,11 +28,13 @@ const server = createMCPServer("my-mcp-server", {
28
28
  * Define MCP tools
29
29
  * Docs: https://docs.mcp-use.com/typescript/server/tools
30
30
  */
31
- server.tool({
32
- name: "fetch-weather",
33
- description: "Fetch the weather for a city",
34
- inputs: [{ name: "city", type: "string", required: true }],
35
- cb: async (params: Record<string, any>) => {
31
+ server.tool(
32
+ {
33
+ name: "fetch-weather",
34
+ description: "Fetch the weather for a city",
35
+ inputs: [{ name: "city", type: "string", required: true }],
36
+ },
37
+ async (params: Record<string, any>) => {
36
38
  const city = params.city as string;
37
39
  const response = await fetch(`https://wttr.in/${city}?format=j1`);
38
40
  const data: any = await response.json();
@@ -45,8 +47,8 @@ server.tool({
45
47
  },
46
48
  ],
47
49
  };
48
- },
49
- });
50
+ }
51
+ );
50
52
 
51
53
  /*
52
54
  * Define MCP resources
@@ -75,11 +77,13 @@ server.resource({
75
77
  * Define MCP prompts
76
78
  * Docs: https://docs.mcp-use.com/typescript/server/prompts
77
79
  */
78
- server.prompt({
79
- name: "review-code",
80
- description: "Review code for best practices and potential issues",
81
- args: [{ name: "code", type: "string", required: true }],
82
- cb: async (params: Record<string, any>) => {
80
+ server.prompt(
81
+ {
82
+ name: "review-code",
83
+ description: "Review code for best practices and potential issues",
84
+ args: [{ name: "code", type: "string", required: true }],
85
+ },
86
+ async (params: Record<string, any>) => {
83
87
  const { code } = params;
84
88
  return {
85
89
  messages: [
@@ -92,8 +96,8 @@ server.prompt({
92
96
  },
93
97
  ],
94
98
  };
95
- },
96
- });
99
+ }
100
+ );
97
101
 
98
102
  const PORT = process.env.PORT ? parseInt(process.env.PORT) : 3000;
99
103
  console.log(`Server running on port ${PORT}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mcp-use-app",
3
- "version": "0.8.0-canary.1",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "Create MCP-Use apps with one command",
6
6
  "author": "mcp-use, Inc.",