From 28f83384eff3d95488a7c2c642ebaac353d30fe2 Mon Sep 17 00:00:00 2001 From: Bill Prin Date: Mon, 8 Jun 2026 10:37:38 -0700 Subject: [PATCH] feat: add python-sdk as a built-in SDK runner target (#329) * feat: add python-sdk as a built-in SDK runner target Wire modelcontextprotocol/python-sdk into the `conformance sdk` runner alongside typescript-sdk and go-sdk, using the SDK's existing conformance fixtures for both client and server modes. Co-Authored-By: Claude Opus 4.8 (1M context) * feat: target python-sdk v1.x on spec 2025-11-25 Convert the built-in python-sdk entry from v2/main to python-sdk-v1, mirroring typescript-sdk-v1: clone the v1.x branch, default specVersion to 2025-11-25 so draft-only scenarios/checks are excluded, and point at the SDK's own expected-failures baseline. v2/main is mid-refactor and noisy; v1.x is the stable published line. Co-Authored-By: Claude Opus 4.8 (1M context) * feat: default sdk-runner server mode to the `active` suite Server runs previously fell through to the underlying `server` command's default; make it explicit and consistent with tiering, which runs the `active` suite (excludes pending/draft). Avoids surfacing intentionally -deferred `pending` scenarios (e.g. json-schema-2020-12, server-sse -polling) as failures. Runner-wide default for all SDKs; callers can still override with --suite. Co-Authored-By: Claude Opus 4.8 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) --- src/sdk-runner/index.ts | 5 ++++- src/sdk-runner/known-sdks.ts | 23 +++++++++++++++++++++++ src/sdk-runner/sdk-runner.test.ts | 10 ++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/sdk-runner/index.ts b/src/sdk-runner/index.ts index 0797163..d4ac74d 100644 --- a/src/sdk-runner/index.ts +++ b/src/sdk-runner/index.ts @@ -273,7 +273,10 @@ export function createSdkCommand(): Command { serverUrl, ...passThrough({ scenario: options.scenario, - suite: options.suite, + // Default to the `active` suite (excludes pending/draft) — the same + // suite tiering runs, and the most reasonable default to avoid + // surfacing intentionally-deferred `pending` scenarios. + suite: options.suite ?? 'active', verbose: options.verbose, output, specVersion diff --git a/src/sdk-runner/known-sdks.ts b/src/sdk-runner/known-sdks.ts index 528bfd8..8a6b30f 100644 --- a/src/sdk-runner/known-sdks.ts +++ b/src/sdk-runner/known-sdks.ts @@ -45,6 +45,29 @@ export const KNOWN_SDKS: Record = { command: './.conformance-server -http=:3000', url: 'http://localhost:3000' } + }, + // v1.x — the stable, published line of the python-sdk, analogous to + // typescript-sdk-v1 (v2/main is mid-refactor and noisy). Clones the + // python-sdk repo, defaulting to the `v1.x` branch, and targets the latest + // dated spec so draft-only scenarios/checks are excluded by default. uv + // workspace: the `mcp` (client) and `mcp-everything-server` (server) packages + // are both members, so one `uv sync --all-packages` covers both modes. + // Fixtures live in the python-sdk repo (.github/actions/conformance/ and + // examples/servers/everything-server). `--port 3000` matches the url and the + // 3000 convention used above; the server's own default is 3001. + 'python-sdk-v1': { + repo: 'python-sdk', + defaultRef: 'v1.x', + specVersion: '2025-11-25', + build: 'uv sync --frozen --all-extras --all-packages', + client: { + command: 'uv run --frozen python .github/actions/conformance/client.py' + }, + server: { + command: 'uv run --frozen mcp-everything-server --port 3000', + url: 'http://localhost:3000/mcp' + }, + expectedFailures: '.github/actions/conformance/expected-failures.yml' } }; diff --git a/src/sdk-runner/sdk-runner.test.ts b/src/sdk-runner/sdk-runner.test.ts index fbfa7fb..6c6353e 100644 --- a/src/sdk-runner/sdk-runner.test.ts +++ b/src/sdk-runner/sdk-runner.test.ts @@ -77,6 +77,16 @@ describe('lookupBuiltinConfig', () => { expect(lookupBuiltinConfig('rust-sdk')).toBeNull(); }); + it('exposes python-sdk-v1 with repo + defaultRef + specVersion and both commands', () => { + const py = lookupBuiltinConfig('python-sdk-v1'); + expect(py?.repo).toBe('python-sdk'); + expect(py?.defaultRef).toBe('v1.x'); + expect(py?.specVersion).toBe('2025-11-25'); + expect(py?.client?.command).toContain('client.py'); + expect(py?.server?.command).toContain('mcp-everything-server'); + expect(py?.server?.url).toBe('http://localhost:3000/mcp'); + }); + it('exposes the typescript-sdk-v1 alias with repo + defaultRef', () => { const v1 = lookupBuiltinConfig('typescript-sdk-v1'); expect(v1?.repo).toBe('typescript-sdk');