create-mcp-use-app 0.9.1 → 0.9.2
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/templates/apps-sdk/index.ts +32 -41
- package/dist/templates/apps-sdk/resources/product-search-result/widget.tsx +2 -2
- package/dist/templates/mcp-ui/index.ts +4 -3
- package/dist/templates/starter/index.ts +3 -2
- package/dist/templates/starter/resources/display-weather.tsx +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MCPServer, object } from "mcp-use/server";
|
|
2
2
|
|
|
3
|
-
const server =
|
|
3
|
+
const server = new MCPServer({
|
|
4
|
+
name: "apps-sdk-mcp-server",
|
|
4
5
|
version: "1.0.0",
|
|
5
|
-
description: "
|
|
6
|
+
description: "MCP server with OpenAI Apps SDK integration",
|
|
7
|
+
baseUrl: process.env.MCP_URL || "http://localhost:3000", // Full base URL (e.g., https://myserver.com)
|
|
6
8
|
// favicon: "favicon.ico", // Uncomment and add your favicon to public/ folder
|
|
7
9
|
});
|
|
8
10
|
|
|
@@ -55,45 +57,34 @@ server.tool(
|
|
|
55
57
|
"Get information about the brand, including company details, mission, and values",
|
|
56
58
|
},
|
|
57
59
|
async () => {
|
|
58
|
-
return {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"Developer Experience",
|
|
73
|
-
"Simplicity",
|
|
74
|
-
"Performance",
|
|
75
|
-
"Open Source",
|
|
76
|
-
"Innovation",
|
|
77
|
-
],
|
|
78
|
-
contact: {
|
|
79
|
-
website: "https://mcp-use.com",
|
|
80
|
-
docs: "https://docs.mcp-use.com",
|
|
81
|
-
github: "https://github.com/mcp-use/mcp-use",
|
|
82
|
-
},
|
|
83
|
-
features: [
|
|
84
|
-
"Automatic UI widget registration",
|
|
85
|
-
"React component support",
|
|
86
|
-
"Full TypeScript support",
|
|
87
|
-
"Built-in HTTP server",
|
|
88
|
-
"MCP protocol compliance",
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
null,
|
|
92
|
-
2
|
|
93
|
-
),
|
|
94
|
-
},
|
|
60
|
+
return object({
|
|
61
|
+
name: "mcp-use",
|
|
62
|
+
tagline: "Build MCP servers with UI widgets in minutes",
|
|
63
|
+
description:
|
|
64
|
+
"mcp-use is a modern framework for building Model Context Protocol (MCP) servers with automatic UI widget registration, making it easy to create interactive AI tools and resources.",
|
|
65
|
+
founded: "2025",
|
|
66
|
+
mission:
|
|
67
|
+
"To simplify the development of MCP servers and make AI integration accessible for developers",
|
|
68
|
+
values: [
|
|
69
|
+
"Developer Experience",
|
|
70
|
+
"Simplicity",
|
|
71
|
+
"Performance",
|
|
72
|
+
"Open Source",
|
|
73
|
+
"Innovation",
|
|
95
74
|
],
|
|
96
|
-
|
|
75
|
+
contact: {
|
|
76
|
+
website: "https://mcp-use.com",
|
|
77
|
+
docs: "https://docs.mcp-use.com",
|
|
78
|
+
github: "https://github.com/mcp-use/mcp-use",
|
|
79
|
+
},
|
|
80
|
+
features: [
|
|
81
|
+
"Automatic UI widget registration",
|
|
82
|
+
"React component support",
|
|
83
|
+
"Full TypeScript support",
|
|
84
|
+
"Built-in HTTP server",
|
|
85
|
+
"MCP protocol compliance",
|
|
86
|
+
],
|
|
87
|
+
});
|
|
97
88
|
}
|
|
98
89
|
);
|
|
99
90
|
|
|
@@ -13,13 +13,13 @@ import "../styles.css";
|
|
|
13
13
|
export const widgetMetadata: WidgetMetadata = {
|
|
14
14
|
description:
|
|
15
15
|
"Display product search results with filtering, state management, and tool interactions",
|
|
16
|
-
|
|
16
|
+
props: propSchema,
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const ProductSearchResult: React.FC = () => {
|
|
20
20
|
const { props, mcp_url } = useWidget<ProductSearchResultProps>();
|
|
21
21
|
|
|
22
|
-
console.log(props);
|
|
22
|
+
console.log(props); // the widget props
|
|
23
23
|
|
|
24
24
|
const accordionItems = [
|
|
25
25
|
{
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MCPServer } from "mcp-use/server";
|
|
2
2
|
import type { RawHtmlUIResource, RemoteDomUIResource } from "mcp-use/server";
|
|
3
3
|
|
|
4
4
|
// Create an MCP server with MCP-UI UIResource support
|
|
5
|
-
const server =
|
|
5
|
+
const server = new MCPServer({
|
|
6
|
+
name: "uiresource-mcp-server",
|
|
6
7
|
version: "1.0.0",
|
|
7
8
|
description: "MCP server demonstrating all UIResource types",
|
|
8
|
-
baseUrl: process.env.MCP_URL, // Full base URL (e.g., https://myserver.com)
|
|
9
|
+
baseUrl: process.env.MCP_URL || "http://localhost:3000", // Full base URL (e.g., https://myserver.com)
|
|
9
10
|
// favicon: "favicon.ico", // Uncomment and add your favicon to public/ folder
|
|
10
11
|
});
|
|
11
12
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MCPServer } from "mcp-use/server";
|
|
2
2
|
|
|
3
3
|
// Create MCP server instance
|
|
4
|
-
const server =
|
|
4
|
+
const server = new MCPServer({
|
|
5
|
+
name: "my-mcp-server",
|
|
5
6
|
version: "1.0.0",
|
|
6
7
|
description: "My first MCP server with all features",
|
|
7
8
|
baseUrl: process.env.MCP_URL || "http://localhost:3000", // Full base URL (e.g., https://myserver.com)
|
|
@@ -23,7 +23,7 @@ const propSchema = z.object({
|
|
|
23
23
|
|
|
24
24
|
export const widgetMetadata: WidgetMetadata = {
|
|
25
25
|
description: "Display weather for a city",
|
|
26
|
-
|
|
26
|
+
props: propSchema,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
type WeatherProps = z.infer<typeof propSchema>;
|
|
@@ -32,7 +32,7 @@ const WeatherWidget: React.FC = () => {
|
|
|
32
32
|
// Use the useWidget hook to get props from OpenAI Apps SDK
|
|
33
33
|
const { props, theme } = useWidget<WeatherProps>();
|
|
34
34
|
|
|
35
|
-
console.log(props);
|
|
35
|
+
console.log(props); // the widget props
|
|
36
36
|
|
|
37
37
|
const { city, weather, temperature } = props;
|
|
38
38
|
const getWeatherIcon = (weatherType: string) => {
|