parent
12cbafe54d
commit
830f0b76e7
2 changed files with 46 additions and 7 deletions
12
.github/workflows/conformance.yml
vendored
12
.github/workflows/conformance.yml
vendored
|
|
@ -14,7 +14,7 @@ permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CONFORMANCE_VERSION: "0.2.0-alpha.10"
|
CONFORMANCE_VERSION: "0.2.0-alpha.11"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
server-conformance:
|
server-conformance:
|
||||||
|
|
@ -32,7 +32,7 @@ jobs:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
- name: Build everything-server
|
- name: Build everything-server
|
||||||
run: go build -o everything-server ./conformance/everything-server
|
run: go build -o everything-server ./conformance/everything-server
|
||||||
- name: Run conformance tests (stateful, legacy spec versions)
|
- name: Run conformance tests (2025-11-25, stateful)
|
||||||
run: |
|
run: |
|
||||||
./everything-server -http=":3001" -stateless=false &
|
./everything-server -http=":3001" -stateless=false &
|
||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
|
|
@ -40,10 +40,9 @@ jobs:
|
||||||
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
|
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
|
||||||
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
|
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
|
||||||
--url http://localhost:3001/mcp \
|
--url http://localhost:3001/mcp \
|
||||||
--suite active \
|
--requirements 2025-11-25 \
|
||||||
--spec-version 2025-11-25 \
|
|
||||||
--expected-failures ./conformance/baseline.yml
|
--expected-failures ./conformance/baseline.yml
|
||||||
- name: Run conformance tests (stateless, 2026-07-28, full suite)
|
- name: Run conformance tests (2026-07-28, stateless)
|
||||||
run: |
|
run: |
|
||||||
./everything-server -http=":3001" -stateless &
|
./everything-server -http=":3001" -stateless &
|
||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
|
|
@ -51,8 +50,7 @@ jobs:
|
||||||
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
|
timeout 30 bash -c 'until curl -s http://localhost:3001/mcp > /dev/null; do sleep 0.5; done'
|
||||||
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
|
npx -y "@modelcontextprotocol/conformance@${CONFORMANCE_VERSION}" server \
|
||||||
--url http://localhost:3001/mcp \
|
--url http://localhost:3001/mcp \
|
||||||
--suite all \
|
--requirements 2026-07-28 \
|
||||||
--spec-version 2026-07-28 \
|
|
||||||
--expected-failures ./conformance/baseline.yml
|
--expected-failures ./conformance/baseline.yml
|
||||||
|
|
||||||
client-conformance:
|
client-conformance:
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ func init() {
|
||||||
registerScenario("elicitation-sep1034-client-defaults", runElicitationDefaultsClient)
|
registerScenario("elicitation-sep1034-client-defaults", runElicitationDefaultsClient)
|
||||||
registerScenario("sse-retry", runSSERetryClient)
|
registerScenario("sse-retry", runSSERetryClient)
|
||||||
registerScenario("json-schema-ref-no-deref", runJSONSchemaRefNoDerefClient)
|
registerScenario("json-schema-ref-no-deref", runJSONSchemaRefNoDerefClient)
|
||||||
|
registerScenario("json-schema-2020-12-preservation", runJSONSchemaPreservationClient)
|
||||||
registerScenario("sep-2322-client-request-state", runMrtrClient)
|
registerScenario("sep-2322-client-request-state", runMrtrClient)
|
||||||
registerScenario("http-standard-headers", runHTTPStandardHeadersClient)
|
registerScenario("http-standard-headers", runHTTPStandardHeadersClient)
|
||||||
registerScenario("http-custom-headers", runHTTPCustomHeadersClient)
|
registerScenario("http-custom-headers", runHTTPCustomHeadersClient)
|
||||||
|
|
@ -343,6 +344,46 @@ func runJSONSchemaRefNoDerefClient(ctx context.Context, serverURL string, _ map[
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// json-schema-2020-12-preservation scenario (SEP-1613, SEP-2106)
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// runJSONSchemaPreservationClient echoes the focal tool's inputSchema back to
|
||||||
|
// the referee verbatim, through the permissive json_schema_echo tool, so that
|
||||||
|
// it can observe which 2020-12 keywords survived the client's parse of
|
||||||
|
// tools/list. The Go SDK surfaces a server's schema as the raw JSON object it
|
||||||
|
// received, so nothing is stripped.
|
||||||
|
func runJSONSchemaPreservationClient(ctx context.Context, serverURL string, _ map[string]any) error {
|
||||||
|
session, err := connectToServer(ctx, serverURL)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer session.Close()
|
||||||
|
|
||||||
|
tools, err := session.ListTools(ctx, nil)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("session.ListTools(): %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
const focalTool = "json_schema_2020_12_tool"
|
||||||
|
idx := slices.IndexFunc(tools.Tools, func(t *mcp.Tool) bool {
|
||||||
|
return t.Name == focalTool
|
||||||
|
})
|
||||||
|
if idx == -1 {
|
||||||
|
return fmt.Errorf("tool %q not found", focalTool)
|
||||||
|
}
|
||||||
|
|
||||||
|
const echoTool = "json_schema_echo"
|
||||||
|
if _, err := session.CallTool(ctx, &mcp.CallToolParams{
|
||||||
|
Name: echoTool,
|
||||||
|
Arguments: map[string]any{"schema": tools.Tools[idx].InputSchema},
|
||||||
|
}); err != nil {
|
||||||
|
return fmt.Errorf("session.CallTool(%q): %v", echoTool, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// SEP-2322 multi-round-trip client scenario
|
// SEP-2322 multi-round-trip client scenario
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue