|
| 1 | +# Debug Server |
| 2 | + |
| 3 | +A comprehensive testing/debugging tool for the MCP Apps SDK that exercises every capability, callback, and result format combination. |
| 4 | + |
| 5 | +## Tools |
| 6 | + |
| 7 | +### debug-tool |
| 8 | + |
| 9 | +Configurable tool for testing all result variations: |
| 10 | + |
| 11 | +| Parameter | Type | Default | Description | |
| 12 | +|-----------|------|---------|-------------| |
| 13 | +| `contentType` | `"text"` \| `"image"` \| `"audio"` \| `"resource"` \| `"resourceLink"` \| `"mixed"` | `"text"` | Content block type to return | |
| 14 | +| `multipleBlocks` | boolean | `false` | Return 3 content blocks | |
| 15 | +| `includeStructuredContent` | boolean | `true` | Include structuredContent in result | |
| 16 | +| `includeMeta` | boolean | `false` | Include _meta in result | |
| 17 | +| `largeInput` | string | - | Large text input (tests tool-input-partial) | |
| 18 | +| `simulateError` | boolean | `false` | Return isError: true | |
| 19 | +| `delayMs` | number | - | Delay before response (ms) | |
| 20 | + |
| 21 | +### debug-refresh |
| 22 | + |
| 23 | +App-only tool (hidden from model) for polling server state. Returns current timestamp and call counter. |
| 24 | + |
| 25 | +## App UI |
| 26 | + |
| 27 | +The debug app provides a dashboard with: |
| 28 | + |
| 29 | +- **Event Log**: Real-time log of all SDK events with filtering |
| 30 | +- **Host Info**: Context, capabilities, container dimensions, styles |
| 31 | +- **Callback Status**: Table of all callbacks with call counts |
| 32 | +- **Actions**: Buttons to test every SDK method: |
| 33 | + - Send messages (text/image) |
| 34 | + - Logging (debug/info/warning/error) |
| 35 | + - Model context updates |
| 36 | + - Display mode requests |
| 37 | + - Link opening |
| 38 | + - Resize controls |
| 39 | + - Server tool calls |
| 40 | + - File operations |
| 41 | + |
| 42 | +## Usage |
| 43 | + |
| 44 | +```bash |
| 45 | +# Build |
| 46 | +npm run --workspace examples/debug-server build |
| 47 | + |
| 48 | +# Run standalone |
| 49 | +npm run --workspace examples/debug-server serve |
| 50 | + |
| 51 | +# Run with all examples |
| 52 | +npm start |
| 53 | +``` |
| 54 | + |
| 55 | +Then open `http://localhost:8080/basic-host/` and select "Debug MCP App Server" from the dropdown. |
0 commit comments