Add JSON Schema 2020-12 conformance test (SEP-1613) (#45)

Add conformance test to validate that MCP servers correctly preserve
JSON Schema 2020-12 keywords ($schema, $defs, additionalProperties)
in tool definitions.

Changes:
- Add JsonSchema2020_12Scenario in src/scenarios/server/json-schema-2020-12.ts
- Add json_schema_2020_12_tool to everything-server with tools/list override
  to return raw JSON Schema instead of Zod-converted schema
- Register scenario in pendingClientScenariosList (requires SDK PR #1135)

The test is added to pending because the client SDK currently strips
the JSON Schema 2020-12 keywords. Once PR #1135 is merged into the SDK,
this scenario can be moved to the active list.
This commit is contained in:
Felix Weinberger 2025-11-20 18:20:06 +00:00 • committed by GitHub
commit f087e44bdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,6 +25,8 @@ import {
ToolsCallEmbeddedResourceScenario
} from './server/tools.js';
import { JsonSchema2020_12Scenario } from './server/json-schema-2020-12.js';
import { ElicitationDefaultsScenario } from './server/elicitation-defaults.js';
import { ElicitationEnumsScenario } from './server/elicitation-enums.js';
@ -51,7 +53,12 @@ import { listMetadataScenarios } from './client/auth/discovery-metadata.js';
// Pending client scenarios (not yet fully tested/implemented)
const pendingClientScenariosList: ClientScenario[] = [
// Elicitation scenarios (SEP-1330)
new ElicitationEnumsScenario()
new ElicitationEnumsScenario(),
// JSON Schema 2020-12 (SEP-1613)
// This test is pending until the SDK includes PR #1135 which preserves
// $schema, $defs, and additionalProperties fields in tool schemas.
new JsonSchema2020_12Scenario()
];
// All client scenarios
@ -76,6 +83,9 @@ const allClientScenariosList: ClientScenario[] = [
new ToolsCallSamplingScenario(),
new ToolsCallElicitationScenario(),
// JSON Schema 2020-12 support (SEP-1613)
new JsonSchema2020_12Scenario(),
// Elicitation scenarios (SEP-1034)
new ElicitationDefaultsScenario(),