test(conformance): bump referee to 0.2.0-alpha.9; arm SEP-2575 diagnostic fixtures; fix post-dispatch -32021 HTTP status (#2399)
This commit is contained in:
parent
1ea960b5bb
commit
3c7ddafa05
4 changed files with 211 additions and 75 deletions
|
|
@ -30,5 +30,8 @@ client: []
|
|||
|
||||
server: []
|
||||
# --- Carried-forward scenarios (also run by the 2025 legs) ---
|
||||
# (empty: json-schema-2020-12 burned by SEP-2106 fixture; sep-2164-resource-not-found
|
||||
# burned by the spec#2907 error-code renumber + alpha.5 referee.)
|
||||
# (empty: json-schema-2020-12 burned by the SEP-2106 fixture;
|
||||
# sep-2164-resource-not-found burned by the spec#2907 error-code renumber +
|
||||
# alpha.5 referee; server-stateless burned by conformance#376 at alpha.9 —
|
||||
# the referee's `requiredCapabilities` assertion now matches the schema's
|
||||
# `ClientCapabilities` object, which is what this SDK emits.)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# 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.7). Newer conformance releases
|
||||
# release pinned in package.json (0.2.0-alpha.9). Newer conformance releases
|
||||
# are adopted by deliberately bumping the package.json pin and reconciling
|
||||
# this file in the same change.
|
||||
#
|
||||
|
|
@ -24,7 +24,7 @@ client: []
|
|||
|
||||
server:
|
||||
# --- SEP-2663 (io.modelcontextprotocol/tasks) — server SDK does not implement the tasks extension ---
|
||||
# Extension-tagged scenarios; selected only by `--suite all` (the alpha.7 referee
|
||||
# Extension-tagged scenarios; selected only by `--suite all` (the alpha.9 referee
|
||||
# has no server-side `--suite extensions`). The active/draft/2026 legs never select
|
||||
# them, so they cannot flag these entries as stale. `tasks-status-notifications` is
|
||||
# intentionally absent: the referee SKIPs it unconditionally (harness rewrite pending
|
||||
|
|
|
|||
|
|
@ -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.7",
|
||||
"@modelcontextprotocol/conformance": "0.2.0-alpha.9",
|
||||
"@modelcontextprotocol/client": "workspace:^",
|
||||
"@modelcontextprotocol/server": "workspace:^",
|
||||
"@modelcontextprotocol/core-internal": "workspace:^",
|
||||
|
|
|
|||
|
|
@ -186,6 +186,63 @@ function createMcpServer() {
|
|||
})
|
||||
);
|
||||
|
||||
// SEP-2575 `server-stateless` diagnostic fixtures: the scenario hardcodes
|
||||
// these three tool names, and at conformance alpha.8 (conformance#372) the
|
||||
// checks behind them fail as untestable when the names are missing.
|
||||
|
||||
// Requires the `sampling` client capability via an MRTR createMessage
|
||||
// input request; the scenario calls it with empty clientCapabilities and
|
||||
// expects -32021 over HTTP 400.
|
||||
mcpServer.registerTool(
|
||||
'test_missing_capability',
|
||||
{
|
||||
description: 'SEP-2575: requires the `sampling` client capability (drives the -32021 undeclared-capability rejection)',
|
||||
inputSchema: z.object({})
|
||||
},
|
||||
async (_args, ctx): Promise<CallToolResult | InputRequiredResult> => {
|
||||
if (ctx.mcpReq.inputResponses?.['llm_answer'] === undefined) {
|
||||
return inputRequired({
|
||||
inputRequests: {
|
||||
llm_answer: inputRequired.createMessage({
|
||||
messages: [{ role: 'user', content: { type: 'text', text: 'Reply with the single word: pong' } }],
|
||||
maxTokens: 16
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
return { content: [{ type: 'text', text: 'sampling round-trip complete' }] };
|
||||
}
|
||||
);
|
||||
|
||||
// A plain successful call: the check only asserts that the response stream
|
||||
// carries no independent top-level JSON-RPC request. It must not elicit
|
||||
// (the scenario declares no `elicitation` capability); the referee's own
|
||||
// reference server does not elicit here either.
|
||||
mcpServer.registerTool(
|
||||
'test_streaming_elicitation',
|
||||
{
|
||||
description: 'SEP-2575: yields a response stream carrying no independent top-level JSON-RPC requests',
|
||||
inputSchema: z.object({})
|
||||
},
|
||||
async (): Promise<CallToolResult> => ({
|
||||
content: [{ type: 'text', text: 'stream observed: result frames only, no top-level requests' }]
|
||||
})
|
||||
);
|
||||
|
||||
// `ctx.mcpReq.log` is gated on the request's `_meta.logLevel`; the scenario
|
||||
// omits it and asserts no notifications/message frame appears.
|
||||
mcpServer.registerTool(
|
||||
'test_logging_tool',
|
||||
{
|
||||
description: 'SEP-2575: logs via ctx.mcpReq.log so the no-log-without-logLevel rule is exercised',
|
||||
inputSchema: z.object({})
|
||||
},
|
||||
async (_args, ctx): Promise<CallToolResult> => {
|
||||
await ctx.mcpReq.log('info', 'test_logging_tool ran (delivered only when the request set _meta.logLevel)');
|
||||
return { content: [{ type: 'text', text: 'logged through the request-scoped, logLevel-gated channel' }] };
|
||||
}
|
||||
);
|
||||
|
||||
// Simple text tool
|
||||
mcpServer.registerTool(
|
||||
'test_simple_text',
|
||||
|
|
|
|||
Loading…
Reference in a new issue