Skip to content

Commit e68bb84

Browse files
RyanAlbertsclaude
andcommitted
docs: register validator in typedoc and document it in the testing guide
- Add src/validator/index.ts to typedoc entryPoints; export the option and result types it references so the JSDoc validation check passes clean - Add a "Validate against the specification" section to testing-mcp-apps.md Refs #673 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b2c564d commit e68bb84

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

docs/testing-mcp-apps.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ description: Test MCP Apps locally with the basic-host reference implementation
88

99
This guide covers two approaches for testing your MCP App: using the `basic-host` reference implementation for local development, or using an MCP Apps-compatible host like Claude\.ai or VS Code.
1010

11+
## Validate against the specification
12+
13+
The SDK ships a validator that checks your server and app against the app-side requirements of the MCP Apps specification — resource format, tool metadata, CSP declarations, and (with [Playwright](https://playwright.dev) installed) the app's observable protocol behavior under a mock host:
14+
15+
```bash
16+
# Validate a running server (streamable HTTP)
17+
npx mcp-app-validator http://localhost:3001/mcp
18+
19+
# Validate a server over stdio, or a built HTML document directly
20+
npx mcp-app-validator --stdio node dist/server.js
21+
npx mcp-app-validator --html dist/mcp-app.html
22+
23+
# CI usage: JSON report, exit code 1 on any MUST-level violation
24+
npx mcp-app-validator http://localhost:3001/mcp --json
25+
```
26+
27+
Every finding cites the rule it violates and the spec section the rule derives from. See the {@link validator! validator} API documentation to run it programmatically.
28+
1129
## Test with basic-host
1230

1331
The [`basic-host`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) example in this repository is a reference host implementation that lets you select a tool, call it, and see your App UI rendered in a sandboxed iframe.

src/validator/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export {
4343
validateServerStatically,
4444
validateAppBehavior,
4545
};
46+
export type { BehavioralOptions } from "./harness.js";
47+
export type { FetchedUiResource, StaticValidationResult } from "./static.js";
4648

4749
/** What to validate. Exactly one of the members must be provided. */
4850
export type ValidationTarget =

typedoc.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const config = {
2525
"src/app-bridge.ts",
2626
"src/message-transport.ts",
2727
"src/types.ts",
28+
"src/validator/index.ts",
2829
],
2930
excludePrivate: true,
3031
excludeInternal: false,

0 commit comments

Comments
 (0)