MCP App Test
Multi-layer test strategy for MCP Apps: protocol-level server tests, browser E2E, and cross-host validation.
Test Layers
| Layer | What | Browser? | Speed | Catches |
|---|---|---|---|---|
| Server API | MCP protocol, tool schemas, resource serving | No | Fast | Regressions in tool logic, broken resources, schema changes |
| E2E | Full rendering, iframe bridge, UI interactions | Yes | Medium | CSS/layout, postMessage, iframe initialization failures |
| Cross-Host | Same app in multiple hosts, compare results | Yes | Slow | Host-specific CSP, permission, rendering differences |
Sub-Files
| File | Purpose |
|---|---|
| server-api.md | Layer 1: MCP protocol tests (no browser) |
| e2e.md | Layer 2: Playwright E2E patterns (page objects, fixtures) |
| cross-host.md | Layer 3: Multi-host validation matrix |
| debugging.md | ui-inspector, DevTools, postMessage tracing |
| references/playwright-patterns.md | Generic fixtures + helpers distilled from a multi-app validation suite |
For new protocol tests, default to MCP 2026-07-28: prove self-contained
requests, server/discover, routing headers, cache scope, MRTR, and explicit
application handles. Keep initialize/Mcp-Session-Id fixtures in a separately
named legacy compatibility suite.
Quick Start
Run the target project's existing tests
cd tests
npm test # use scripts already defined by the target project
Prerequisites
Start only the servers required by the selected tests. Prefer test fixtures or workspace tasks that own process startup and teardown rather than assuming a specific repository launcher.