Skip to main content
The Protocol Conformance SDK lets you run the same checks as the CLI protocol conformance commands, but inside your own Jest or Vitest suites. Use it when you want MCP protocol regressions to fail CI directly, or when you need JUnit XML and JSON artifacts from code rather than shell scripts.
Protocol conformance is currently HTTP-only. For local stdio-only servers, use MCP Apps Conformance, unit tests, or run your server through an HTTP bridge in CI.

Import

Single run

Suite

MCPConformanceSuiteConfig keeps the existing serverUrl + defaults + runs shape:

MCPConformanceConfig

Available categories and check ids

Categories:
  • core
  • protocol
  • tools
  • prompts
  • resources
  • security
  • transport
Check ids:
  • server-initialize
  • ping
  • logging-set-level
  • completion-complete
  • capabilities-consistent
  • tools-list
  • tools-input-schemas-valid
  • tools-x-mcp-header-declarations-valid (2026-07-28 only)
  • prompts-list
  • resources-list
  • protocol-invalid-method-error
  • localhost-host-rebinding-rejected — requires HTTP 403 when the run explicitly pins protocolVersion to 2025-11-25 or later; accepts any 4xx on earlier pins or when no version is pinned
  • localhost-host-valid-accepted
  • server-sse-polling-session
  • server-accepts-multiple-post-streams
  • server-sse-streams-functional
  • notification-post-accepted (2025 revisions only)
  • get-stream-or-405 (2025 revisions only)
  • session-id-visible-ascii (2025 revisions only)
  • post-response-content-type

Result types

MCPConformanceTest.run() returns an MCPConformanceResult: Each MCPCheckResult includes a skipReason field whenever status is "skipped":
  • "not-applicable" — the check cannot apply to this server (era-gated check on the wrong protocol version, unadvertised capability, localhost-only requirement against a remote server). These never hold a run back.
  • "could-not-run" — the check applies but was never exercised (broken session, missing inputRequiredProbe, subscription stream unavailable). These make the run incomplete.
MCPConformanceSuite.run() returns an MCPConformanceSuiteResult:

Outcomes: passed, failed, incomplete

A run reports one of three outcomes, and passed is true only for the first: An incomplete run carries a root incompleteReason naming the checks that did not run and what to change; non-quiet CLI runs also print it to stderr. For a suite, the exit code is the worst of all runs (failure outranks incomplete).

Readiness advice

Every run also collects a readiness channel: advisory observations about server behavior that the spec does not mandate but that indicate potential issues. Readiness items never affect outcome, passed, or exit codes — they are informational only. Each MCPReadinessWarning has: The CLI prints readiness items as an Advice section on stderr after each protocol conformance or conformance-suite run. The section is suppressed by --quiet and does not appear in JSON or JUnit XML output. Current readiness checks:
  • readiness-parse-error-handling — fires when the server accepts an unparseable JSON body as success without returning a JSON-RPC -32700 parse error. No MCP revision mandates a specific response to malformed input, so this is MAY advice rather than a check.
  • readiness-session-termination — on 2025-era runs, fires when a session-termination DELETE returns a 5xx. On 2026-era runs, fires when GET or DELETE traffic from an older client is not answered with HTTP 405 (the 2026 backward-compat SHOULD).

CI reporting

All three conformance domains share the same report helpers:
  • toConformanceReport(result)
  • renderConformanceReportJUnitXml(report)
  • renderConformanceReportJson(report)
The CLI uses the same helpers internally, so protocol conformance --format junit-xml and protocol conformance-suite --format junit-xml emit the same XML that the SDK helpers produce for the same result.