Skip to content

Commit 00023ba

Browse files
committed
npm run prettier:fix
1 parent ec306a8 commit 00023ba

File tree

4 files changed

+53
-37
lines changed

4 files changed

+53
-37
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ This repo contains the SDK and [specification](./specification/draft/apps.mdx) f
55
MCP Apps are proposed standard inspired by [MCP-UI](https://mcpui.dev/) and [OpenAI's Apps SDK](https://developers.openai.com/apps-sdk/) to allow MCP Servers to display interactive UI elements in conversational MCP clients / chatbots.
66

77
This repo provides:
8+
89
- [types.ts](./src/types.ts): Types of JSON-RPC messages used to communicate between Apps & their host
910
- Note that MCP Apps also use some standard MCP messages (e.g. `tools/call` for the App to trigger actions on its originating Server - these calls are proxied through the Host), but these types are the additional messages defined by the extension
10-
1111
- [examples/simple-example](./examples/simple-example): Example Server + Apps
1212
- [server.ts](./examples/simple-server/server.ts): MCP server with two tools that declare UI resources of Apps to be show in the chat when called
1313
- [ui-react.tsx](./examples/simple-server/src/ui-react.tsx): React App returned by the `create-ui-react` tool shows how to use the `useApp` hook to register MCP callbacks
1414
- [ui-vanilla.tsx](./examples/simple-server/src/ui-vanilla.ts): vanilla App returned by the `create-ui-vanilla`
15-
1615
- [specification/draft/apps.mdx](./specification/draft/apps.mdx): The Draft Extension Specification. It's still... in flux! Feedback welcome! (also see discussions in [SEP-1865](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/1865)).
1716

1817
- [message-transport](./src/message-transport.ts): `PostMessageTransport` class that uses `postMessage` to exchange JSON-RPC messages between windows / iframes

build.bun.ts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,28 @@ const isDevelopment = Bun.env.NODE_ENV === "development";
88

99
// Build all JavaScript/TypeScript files
1010
function buildJs(entrypoint: string, opts: Record<string, any> = {}) {
11-
return Bun.build({
12-
entrypoints: [entrypoint],
13-
outdir: "dist",
14-
target: "browser",
15-
minify: !isDevelopment,
16-
...(isDevelopment ? {
17-
sourcemap: "inline",
18-
} : {}),
19-
...opts
20-
})
11+
return Bun.build({
12+
entrypoints: [entrypoint],
13+
outdir: "dist",
14+
target: "browser",
15+
minify: !isDevelopment,
16+
...(isDevelopment
17+
? {
18+
sourcemap: "inline",
19+
}
20+
: {}),
21+
...opts,
22+
});
2123
}
2224

2325
await Promise.all([
2426
buildJs("src/app.ts", { outdir: "dist/src" }),
25-
buildJs("src/app-bridge.ts", { outdir: "dist/src", external: ["@modelcontextprotocol/sdk"] }),
26-
buildJs("src/react/index.tsx", { outdir: "dist/src/react", external: ["react", "react-dom"]}),
27-
])
27+
buildJs("src/app-bridge.ts", {
28+
outdir: "dist/src",
29+
external: ["@modelcontextprotocol/sdk"],
30+
}),
31+
buildJs("src/react/index.tsx", {
32+
outdir: "dist/src/react",
33+
external: ["react", "react-dom"],
34+
}),
35+
]);

examples/simple-server/server.ts

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ const getServer = async () => {
6161
};
6262

6363
{
64-
const rawResource = registerResource({
65-
name: "ui-raw-template",
66-
uri: "ui://raw",
67-
title: "Raw UI Template",
68-
description: "A simple raw HTML UI",
69-
mimeType: "text/html+mcp",
70-
}, rawHtml);
64+
const rawResource = registerResource(
65+
{
66+
name: "ui-raw-template",
67+
uri: "ui://raw",
68+
title: "Raw UI Template",
69+
description: "A simple raw HTML UI",
70+
mimeType: "text/html+mcp",
71+
},
72+
rawHtml,
73+
);
7174

7275
server.registerTool(
7376
"create-ui-raw",
@@ -89,13 +92,16 @@ const getServer = async () => {
8992
}
9093

9194
{
92-
const vanillaResource = registerResource({
93-
name: "ui-vanilla-template",
94-
uri: "ui://vanilla",
95-
title: "Vanilla UI Template",
96-
description: "A simple vanilla JS UI",
97-
mimeType: "text/html+mcp",
98-
}, vanillaHtml);
95+
const vanillaResource = registerResource(
96+
{
97+
name: "ui-vanilla-template",
98+
uri: "ui://vanilla",
99+
title: "Vanilla UI Template",
100+
description: "A simple vanilla JS UI",
101+
mimeType: "text/html+mcp",
102+
},
103+
vanillaHtml,
104+
);
99105

100106
server.registerTool(
101107
"create-ui-vanilla",
@@ -117,13 +123,16 @@ const getServer = async () => {
117123
}
118124

119125
{
120-
const reactResource = registerResource({
121-
name: "ui-react-template",
122-
uri: "ui://react",
123-
title: "React UI Template",
124-
description: "A React-based UI",
125-
mimeType: "text/html+mcp",
126-
}, reactHtml);
126+
const reactResource = registerResource(
127+
{
128+
name: "ui-react-template",
129+
uri: "ui://react",
130+
title: "React UI Template",
131+
description: "A React-based UI",
132+
mimeType: "text/html+mcp",
133+
},
134+
reactHtml,
135+
);
127136

128137
server.registerTool(
129138
"create-ui-react",

src/react/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from "./useApp";
2-
export * from "./useAutoResize";
2+
export * from "./useAutoResize";

0 commit comments

Comments
 (0)