docs: client log levels, elicitation completion notification; drive json-schema-2020-12-preservation on the alpha.11 referee (#2686)
This commit is contained in:
parent
68523682fd
commit
a81ef34ac1
4 changed files with 334 additions and 13 deletions
|
|
@ -12,8 +12,16 @@
|
|||
# 2025 legs.
|
||||
#
|
||||
# Baseline established against the published @modelcontextprotocol/conformance
|
||||
# release pinned in package.json. Newer conformance releases are adopted by
|
||||
# deliberately bumping the pin and reconciling this file in the same change.
|
||||
# release pinned in package.json (0.2.0-alpha.11). Newer conformance releases
|
||||
# are adopted by deliberately bumping the pin and reconciling this file in the
|
||||
# same change.
|
||||
#
|
||||
# alpha.10 -> alpha.11 reconciliation: `json-schema-2020-12-preservation`
|
||||
# (client leg; everythingClient negotiates via server/discover like tools_call)
|
||||
# passes at 2026-07-28 — the referee reports it as added-after-release, unscored
|
||||
# on the frozen 2026-07-28 set — and `server-session-lifecycle` is not
|
||||
# applicable at 2026-07-28 (removed in that revision, skipped by
|
||||
# --spec-version), so both sections stay empty.
|
||||
#
|
||||
# NOTE: the SDK's modern-path rejection codes are aligned with what this
|
||||
# referee asserts — both sides have adopted the spec#2907 / conformance#353
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@
|
|||
# CI exits 0 if only these fail, exits 1 on unexpected failures or stale entries.
|
||||
#
|
||||
# Baseline established against the published @modelcontextprotocol/conformance
|
||||
# release pinned in package.json (0.2.0-alpha.10). Newer conformance releases
|
||||
# release pinned in package.json (0.2.0-alpha.11). Newer conformance releases
|
||||
# are adopted by deliberately bumping the package.json pin and reconciling
|
||||
# this file in the same change.
|
||||
#
|
||||
# alpha.10 -> alpha.11 reconciliation: the referee added two scenarios, both
|
||||
# passing, so neither is baselined — `json-schema-2020-12-preservation`
|
||||
# (client; SEP-1613/SEP-2106 keyword round-trip, driven by everythingClient.ts)
|
||||
# and `server-session-lifecycle` (server; Streamable HTTP session teardown).
|
||||
# The referee now also sends HTTP DELETE after every session-bound scenario
|
||||
# (conformance#316); the everything server already answers it.
|
||||
#
|
||||
# NOTE: the SDK's modern-path rejection codes are aligned with what this
|
||||
# referee asserts — both sides have adopted the spec#2907 / conformance#353
|
||||
# renumber (-32020 HeaderMismatch / -32021 MissingRequiredClientCapability /
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
"test:conformance:all": "pnpm run test:conformance:client:all && pnpm run test:conformance:server:all"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@modelcontextprotocol/conformance": "0.2.0-alpha.10",
|
||||
"@modelcontextprotocol/conformance": "0.2.0-alpha.11",
|
||||
"@modelcontextprotocol/client": "workspace:^",
|
||||
"@modelcontextprotocol/server": "workspace:^",
|
||||
"@modelcontextprotocol/core-internal": "workspace:^",
|
||||
|
|
|
|||
|
|
@ -802,6 +802,62 @@ async function runJsonSchemaRefNoDerefClient(serverUrl: string): Promise<void> {
|
|||
|
||||
registerScenario('json-schema-ref-no-deref', runJsonSchemaRefNoDerefClient);
|
||||
|
||||
// ============================================================================
|
||||
// JSON Schema 2020-12 keyword preservation scenario (SEP-1613, SEP-2106)
|
||||
// ============================================================================
|
||||
|
||||
/** The tool whose `inputSchema` carries the full JSON Schema 2020-12 fixture. */
|
||||
const JSON_SCHEMA_2020_12_TOOL = 'json_schema_2020_12_tool';
|
||||
/** The permissive echo tool that hands the observed schema back to the referee. */
|
||||
const JSON_SCHEMA_ECHO_TOOL = 'json_schema_echo';
|
||||
|
||||
/**
|
||||
* The scenario advertises a focal tool whose inputSchema uses `$schema`,
|
||||
* `$defs` (with `$anchor`), `additionalProperties`, composition
|
||||
* (`allOf`/`anyOf`) and conditional (`if`/`then`/`else`) keywords. The client
|
||||
* lists tools and passes that inputSchema back verbatim — exactly as
|
||||
* `listTools()` exposes it — through `tools/call json_schema_echo`, so the
|
||||
* referee can diff what survived the SDK's parsing against its fixture.
|
||||
*
|
||||
* The scenario spans both eras: under a 2026-07-28 run the client negotiates
|
||||
* the modern lifecycle via server/discover (as tools_call does) and drives the
|
||||
* same list → echo flow.
|
||||
*/
|
||||
async function runJsonSchema2020_12PreservationClient(serverUrl: string): Promise<void> {
|
||||
const client = new Client(
|
||||
{ name: 'json-schema-2020-12-preservation-client', version: '1.0.0' },
|
||||
isModernConformanceRun() ? { capabilities: {}, versionNegotiation: { mode: 'auto' } } : { capabilities: {} }
|
||||
);
|
||||
|
||||
const transport = new StreamableHTTPClientTransport(new URL(serverUrl));
|
||||
|
||||
await client.connect(transport);
|
||||
logger.debug('Successfully connected to MCP server');
|
||||
|
||||
const tools = await client.listTools();
|
||||
logger.debug(
|
||||
'Available tools:',
|
||||
tools.tools.map(t => t.name)
|
||||
);
|
||||
|
||||
const focal = tools.tools.find(t => t.name === JSON_SCHEMA_2020_12_TOOL);
|
||||
if (!focal) {
|
||||
throw new Error(`Tool '${JSON_SCHEMA_2020_12_TOOL}' not advertised by the server`);
|
||||
}
|
||||
logger.debug('Observed inputSchema:', JSON.stringify(focal.inputSchema, null, 2));
|
||||
|
||||
const result = await client.callTool({
|
||||
name: JSON_SCHEMA_ECHO_TOOL,
|
||||
arguments: { schema: focal.inputSchema }
|
||||
});
|
||||
logger.debug('Echo result:', JSON.stringify(result, null, 2));
|
||||
|
||||
await client.close();
|
||||
logger.debug('Connection closed successfully');
|
||||
}
|
||||
|
||||
registerScenario('json-schema-2020-12-preservation', runJsonSchema2020_12PreservationClient);
|
||||
|
||||
// ============================================================================
|
||||
// Main entry point
|
||||
// ============================================================================
|
||||
|
|
|
|||
Loading…
Reference in a new issue