Skip to content

Commit 9afbf92

Browse files
committed
Add kitchen-sink-lite app with UI kit styling and MCP server examples
1 parent 2724141 commit 9afbf92

File tree

18 files changed

+5307
-198
lines changed

18 files changed

+5307
-198
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,21 @@ The MCP servers in this demo highlight how each tool can light up widgets by com
3636
- `pizzaz_server_node/` – MCP server implemented with the official TypeScript SDK.
3737
- `pizzaz_server_python/` – Python MCP server that returns the Pizzaz widgets.
3838
- `solar-system_server_python/` – Python MCP server for the 3D solar system widget.
39+
- `kitchen_sink_server_node/` – Node MCP server for the kitchen-sink-lite widget.
40+
- `kitchen_sink_server_python/` – Python MCP server for the kitchen-sink-lite widget.
3941
- `build-all.mts` – Vite build orchestrator that produces hashed bundles for every widget entrypoint.
4042

43+
### Kitchen sink lite overview
44+
45+
The kitchen sink lite sample shows the full `window.openai` surface working together:
46+
47+
- Reads host state (`toolInput`, `toolOutput`, `displayMode`, `theme`, `widgetState`).
48+
- Writes host state with `setWidgetState`.
49+
- Calls another MCP tool from the widget with `callTool`.
50+
- Uses host helpers like `requestDisplayMode`, `openExternal`, and `sendFollowUpMessage`.
51+
52+
Use it as a reference for how to wire UI to MCP tool responses and host APIs with the Apps SDK UI components.
53+
4154
## Prerequisites
4255

4356
- Node.js 18+
@@ -90,6 +103,7 @@ The repository ships several demo MCP servers that highlight different widget bu
90103

91104
- **Pizzaz (Node & Python)** – pizza-inspired collection of tools and components
92105
- **Solar system (Python)** – 3D solar system viewer
106+
- **Kitchen sink lite (Node & Python)** – minimal widget + server pairing that demonstrates tool output, widget state, `callTool`, and host helpers
93107

94108
### Pizzaz Node server
95109

@@ -116,6 +130,21 @@ pip install -r solar-system_server_python/requirements.txt
116130
uvicorn solar-system_server_python.main:app --port 8000
117131
```
118132

133+
### Kitchen sink lite Node server
134+
135+
```bash
136+
pnpm --filter kitchen-sink-mcp-node start
137+
```
138+
139+
### Kitchen sink lite Python server
140+
141+
```bash
142+
python -m venv .venv
143+
source .venv/bin/activate
144+
pip install -r kitchen_sink_server_python/requirements.txt
145+
uvicorn kitchen_sink_server_python.main:app --port 8000
146+
```
147+
119148
You can reuse the same virtual environment for all Python servers—install the dependencies once and run whichever entry point you need.
120149

121150
## Testing in ChatGPT

build-all.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const targets: string[] = [
2222
"pizzaz-list",
2323
"pizzaz-albums",
2424
"pizzaz-shop",
25+
"kitchen-sink-lite",
2526
];
2627
const builtNames: string[] = [];
2728

kitchen_sink_server_node/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Kitchen Sink Lite MCP server (Node)
2+
3+
TypeScript implementation of the minimal kitchen-sink widget server using the official Model Context Protocol SDK.
4+
5+
It exposes two tools:
6+
7+
- `kitchen-sink-show`: returns the widget template plus structured content for the initial render.
8+
- `kitchen-sink-refresh`: lightweight echo tool so the widget can call back via `window.openai.callTool`.
9+
10+
Both tools return `_meta.openai/outputTemplate` pointing to `ui://widget/kitchen-sink-lite.html`.
11+
12+
## Prereqs
13+
14+
- Node 18+
15+
- Static assets built (run `pnpm run build` from the repo root). The server loads `assets/kitchen-sink-lite*.html`.
16+
17+
## Install & run
18+
19+
```bash
20+
pnpm install
21+
pnpm --filter kitchen-sink-mcp-node start
22+
# or, from this folder:
23+
pnpm start
24+
```
25+
26+
The server listens on `http://localhost:8000/mcp` (SSE) and `POST /mcp/messages` for messages. You can change the port with `PORT=9000 pnpm start`.

0 commit comments

Comments
 (0)