Skip to content

Commit 830f0b7

Browse files
mcp: update conformance tests (#1231)
Fixes #1230
1 parent 12cbafe commit 830f0b7

2 files changed

Lines changed: 46 additions & 7 deletions

File tree

‎.github/workflows/conformance.yml‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414
contents: read
1515

1616
env:
17-
CONFORMANCE_VERSION: "0.2.0-alpha.10"
17+
CONFORMANCE_VERSION: "0.2.0-alpha.11"
1818

1919
jobs:
2020
server-conformance:
@@ -32,27 +32,25 @@ jobs:
3232
node-version: 22
3333
- name: Build everything-server
3434
run: go build -o everything-server ./conformance/everything-server
35-
- name: Run conformance tests (stateful, legacy spec versions)
35+
- name: Run conformance tests (2025-11-25, stateful)
3636
run: |
3737
./everything-server -http=":3001" -stateless=false &
3838
SERVER_PID=$!
3939
trap "kill -9 $SERVER_PID 2>/dev/null || true; wait $SERVER_PID 2>/dev/null || true" EXIT
4040
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
4141
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
4242
--url http://localhost:3001/mcp \
43-
--suite active \
44-
--spec-version 2025-11-25 \
43+
--requirements 2025-11-25 \
4544
--expected-failures ./conformance/baseline.yml
46-
- name: Run conformance tests (stateless, 2026-07-28, full suite)
45+
- name: Run conformance tests (2026-07-28, stateless)
4746
run: |
4847
./everything-server -http=":3001" -stateless &
4948
SERVER_PID=$!
5049
trap "kill -9 $SERVER_PID 2>/dev/null || true; wait $SERVER_PID 2>/dev/null || true" EXIT
5150
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
5251
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
5352
--url http://localhost:3001/mcp \
54-
--suite all \
55-
--spec-version 2026-07-28 \
53+
--requirements 2026-07-28 \
5654
--expected-failures ./conformance/baseline.yml
5755
5856
client-conformance:

‎conformance/everything-client/main.go‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func init() {
4949
registerScenario("elicitation-sep1034-client-defaults", runElicitationDefaultsClient)
5050
registerScenario("sse-retry", runSSERetryClient)
5151
registerScenario("json-schema-ref-no-deref", runJSONSchemaRefNoDerefClient)
52+
registerScenario("json-schema-2020-12-preservation", runJSONSchemaPreservationClient)
5253
registerScenario("sep-2322-client-request-state", runMrtrClient)
5354
registerScenario("http-standard-headers", runHTTPStandardHeadersClient)
5455
registerScenario("http-custom-headers", runHTTPCustomHeadersClient)
@@ -343,6 +344,46 @@ func runJSONSchemaRefNoDerefClient(ctx context.Context, serverURL string, _ map[
343344
return nil
344345
}
345346

347+
// ============================================================================
348+
// json-schema-2020-12-preservation scenario (SEP-1613, SEP-2106)
349+
// ============================================================================
350+
351+
// runJSONSchemaPreservationClient echoes the focal tool's inputSchema back to
352+
// the referee verbatim, through the permissive json_schema_echo tool, so that
353+
// it can observe which 2020-12 keywords survived the client's parse of
354+
// tools/list. The Go SDK surfaces a server's schema as the raw JSON object it
355+
// received, so nothing is stripped.
356+
func runJSONSchemaPreservationClient(ctx context.Context, serverURL string, _ map[string]any) error {
357+
session, err := connectToServer(ctx, serverURL)
358+
if err != nil {
359+
return err
360+
}
361+
defer session.Close()
362+
363+
tools, err := session.ListTools(ctx, nil)
364+
if err != nil {
365+
return fmt.Errorf("session.ListTools(): %v", err)
366+
}
367+
368+
const focalTool = "json_schema_2020_12_tool"
369+
idx := slices.IndexFunc(tools.Tools, func(t *mcp.Tool) bool {
370+
return t.Name == focalTool
371+
})
372+
if idx == -1 {
373+
return fmt.Errorf("tool %q not found", focalTool)
374+
}
375+
376+
const echoTool = "json_schema_echo"
377+
if _, err := session.CallTool(ctx, &mcp.CallToolParams{
378+
Name: echoTool,
379+
Arguments: map[string]any{"schema": tools.Tools[idx].InputSchema},
380+
}); err != nil {
381+
return fmt.Errorf("session.CallTool(%q): %v", echoTool, err)
382+
}
383+
384+
return nil
385+
}
386+
346387
// ============================================================================
347388
// SEP-2322 multi-round-trip client scenario
348389
// ============================================================================

0 commit comments

Comments
 (0)