Skip to content

Add conformance-server + importable conformance runner (addresses #674)#726

Open
qchuchu wants to merge 5 commits into
modelcontextprotocol:mainfrom
qchuchu:conformance-server
Open

Add conformance-server + importable conformance runner (addresses #674)#726
qchuchu wants to merge 5 commits into
modelcontextprotocol:mainfrom
qchuchu:conformance-server

Conversation

@qchuchu

@qchuchu qchuchu commented Jul 23, 2026

Copy link
Copy Markdown

Supersedes #693 (that PR became unreopenable after a rebase + force-push; this is the same branch, rebased onto latest main).

Summary

Two parts, both under the MCP Apps conformance umbrella (a step toward #674):

  1. examples/conformance-server — a ui:// TestSuite that renders inside the host's sandboxed iframe, drives the postMessage/JSON-RPC bridge, and asserts host behaviour against the spec (2026-01-26). Rebuilt on a typed capability protocol: a test emits a CapabilityRequest and awaits the result over a window.__mcpConformance pull channel. Split harness (assert/host-gateway/registry engine/channel), 8 starter tests spanning automatic / operator-DOM / agent-interaction / capability-fallback, and a host-neutral implementer guide.

  2. An importable conformance runner — new SDK subpaths so any host can conformance-test itself (dev-only):

    • @modelcontextprotocol/ext-apps/conformanceHost interface, an abstract Playwright BrowserHost (subclass it for your host), and a Runner that returns SubtestResult[].
    • @modelcontextprotocol/ext-apps/conformance/protocol — the isomorphic protocol types (imported by the app view and the runner alike).
    • playwright is declared as an optional peer dependency (kept external from the browser bundle).

Product-specific driver bits (named-host adapters, results/video/report generators) intentionally stay out of the SDK.

Testing

  • npm run build (SDK) + npm run --workspace examples/conformance-server build: clean.
  • npm run prettier: clean.
  • E2E golden snapshot regenerated via the pinned Playwright image; servers.spec.ts passes for the conformance server (screenshot unchanged).

🤖 Generated with Claude Code

qchuchu and others added 5 commits July 23, 2026 09:50
A WPT-style host-conformance test runner for the MCP Apps spec (2026-01-26): ships a ui:// page that renders inside the host's sandboxed iframe, drives the postMessage/JSON-RPC bridge, asserts host behaviour against the spec, and reports PASS/FAIL right in the iframe.

First step toward modelcontextprotocol#674 (public MCP Apps platform tests). Mirrors the basic-server-react layout/toolchain and is registered alongside the other examples in both E2E specs and both publish workflows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…typed TestSuite

SDK: new subpaths `@modelcontextprotocol/ext-apps/conformance` (Host interface,
abstract Playwright BrowserHost, Runner → SubtestResult[]) and isomorphic
`/conformance/protocol`; playwright declared as an optional peer dependency.

examples/conformance-server: rewritten on the typed capability protocol
(window.__mcpConformance pull model) — split harness (assert/host-gateway/registry/
channel), 8 starter tests spanning automatic/operator/interaction/fallback, and a
host-neutral implementer guide + BrowserHost subclass template.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant