Skip to the content.

ADR-0003 — Conformance is asserted against the published schema, not hand-written strings

Context

The existing test suite asserts on substrings: assert_contains "$response" '"tools"'. That proves a key is present somewhere in the bytes. It cannot catch a missing required resultType, a ttlMs emitted as a string instead of an integer, or a cacheScope outside its enum — every one of which is a spec violation a real client will reject.

MCP publishes a machine-readable JSON Schema per revision (schema/2026-07-28/schema.json, ~180 KB). It defines exactly the shapes we must emit: JSONRPCResultResponse, ListToolsResult, CallToolResult, DiscoverResult, UnsupportedProtocolVersionError.

Decision

Vendor the official schema at spec/schema-2026-07-28.json and validate real server output against it in a conformance test (test_conformance.sh). The bash test suite keeps its fast substring checks for control flow and error paths; the conformance test is the arbiter of wire correctness.

Validation shells out to Python’s jsonschema. The test skips with a clear message, not a failure, when that module is absent, so jq remains the only hard dependency for running the server (ADR-0005) and for the core unit tests.

Consequences

Good

Bad / accepted

Alternatives considered