feat(debug-server): add interactive debug server example (#321)

* feat(examples): add debug-server example

A comprehensive debug/development server for testing MCP Apps SDK features:
- Vanilla TypeScript UI with collapsible panels
- Message visualization (sent, received, errors)
- Server tool calling interface
- Multiple tool endpoints for testing

* refactor(debug-server): convert to React

- Replace vanilla TypeScript with React components
- Add comprehensive Host Styles panel showing all CSS variables grouped by category
- Use React hooks (useApp, useHostStyles, useAutoResize)
- Cleaner state management with useReducer for event log
- Collapsible sections for better organization
- CSS modules for scoped styling

* fix(debug-server): correct server name in main.ts

* Revert "refactor(debug-server): convert to React"

This reverts commit 5d22d2daa9a98ba412892447202ef10fbdb62f5b.

* fix(debug-server): update default values for multipleBlocks and includeMeta

* fix(debug-server): correct serve script and server name

- serve script now runs main.ts instead of server.ts
- Updated server name to 'Debug Server'
- Fixed npx command in comment

* fix: increase maxHeight to 6000px and add tools capability to debug app

- basic-host: Increase maxHeight from 600 to 6000px
- debug-server: Add tools capability to enable oncalltool/onlisttools handlers

* fix(debug-server): use consistent callback names for event tracking

Event types now match callback names (ontoolinput, ontoolresult, etc.)
so the Callback Status panel shows correct counts and payloads.

* feat(debug-server): add Update (Image) button for model context

* feat(debug-server): add expandable event log entries

- Click on any event log row to expand/collapse
- Arrow indicator rotates when expanded
- Full JSON payload shown indented in pre block
- Max height with scroll for large payloads

* style(debug-server): format long line in fullPayload function

* test(debug-server): add to E2E tests and screenshot specs

* chore: regenerate package-lock.json for cross-platform compatibility

* update dep
This commit is contained in:
Olivier Chafik 2026-01-23 12:39:40 +00:00 • committed by GitHub
commit 8a877b36b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2253 additions and 435 deletions

View file

@ -55,6 +55,7 @@ const ALL_SERVERS = [
name: "Customer Segmentation Server",
dir: "customer-segmentation-server",
},
{ key: "debug-server", name: "Debug MCP App Server", dir: "debug-server" },
{ key: "map-server", name: "Map Server", dir: "map-server" },
{ key: "pdf-server", name: "PDF Server", dir: "pdf-server" },
{ key: "qr-server", name: "QR Code Server", dir: "qr-server" },

View file

@ -16,6 +16,7 @@ const DYNAMIC_MASKS: Record<string, string[]> = {
"basic-vue": ["#server-time"], // Server time display
"cohort-heatmap": ['[class*="heatmapWrapper"]'], // Heatmap grid (random data)
"customer-segmentation": [".chart-container"], // Scatter plot (random data)
"debug-server": ["#event-log", "#callback-table-body"], // Event log and callback counts (dynamic)
"say-server": [".playBtn", ".playOverlayBtn"], // Play buttons may have different states
shadertoy: ["#canvas"], // WebGL shader canvas (animated)
"system-monitor": [
@ -96,6 +97,7 @@ const ALL_SERVERS = [
name: "Customer Segmentation Server",
dir: "customer-segmentation-server",
},
{ key: "debug-server", name: "Debug MCP App Server", dir: "debug-server" },
{ key: "map-server", name: "Map Server", dir: "map-server" },
{ key: "pdf-server", name: "PDF Server", dir: "pdf-server" },
{ key: "qr-server", name: "QR Code Server", dir: "qr-server" },

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB