feat(sdk-runner): add rust-sdk + per-spec-version config overlays (#419)
* feat(sdk-runner): add rust-sdk to KNOWN_SDKS The mcp-conformance package's fixture bins follow the harness contract directly (URL argv + MCP_CONFORMANCE_SCENARIO env), and the server selects the SEP-2575 stateless lifecycle via STATELESS=1. Requires the repo's pinned Rust toolchain (rustup installs it on demand). * feat(sdk-runner): per-spec-version config overlays (specOverrides) Several KNOWN_SDKS entries needed a different invocation when targeting 2026-07-28 — go-sdk's -stateless flag, csharp-sdk's /stateless URL, rust-sdk's STATELESS=1 env, python-sdk's per-revision baseline — and each carried a comment telling the caller which flag to paste. Encode those variants in the entry instead: specOverrides maps a canonical spec version to a partial config that is merged over the base entry when a run targets that version (--spec-version, after 'draft' alias resolution, or the entry's own specVersion default). Explicit CLI flags still win. Keys are validated against the known spec versions at schema level so a 'draft' key or a typo'd date fails loudly instead of silently never matching. * style: prettier fixes in sdk-runner tests * refactor(sdk-runner): reuse isSpecVersion for specOverrides key validation Reuses the canonical spec-version list from #421 instead of keeping a separate copy; SPEC_VERSION_TIMELINE is now exported so the validation message can enumerate the valid keys.
This commit is contained in:
parent
5cc567c399
commit
49103de6ed
1 changed files with 241 additions and 28 deletions
|
|
@ -40,10 +40,9 @@ export const KNOWN_SDKS: Record<string, SdkConfig> = {
|
|||
},
|
||||
// Fixtures live under conformance/ (everything-client + everything-server,
|
||||
// mirroring scripts/{client,server}-conformance.sh). The server's -stateless
|
||||
// flag defaults to true; -stateless=false pins the stateful transport, which
|
||||
// the dated-spec (`active` suite) scenarios need — for a 2026-07-28 /
|
||||
// SEP-2575 run, override with --server-cmd './.conformance-server -http=localhost:3000'
|
||||
// to get the stateless lifecycle.
|
||||
// flag defaults to true; the dated-spec (`active` suite) scenarios need the
|
||||
// stateful transport, so the base command pins -stateless=false and the
|
||||
// 2026-07-28 override drops it for the SEP-2575 stateless lifecycle.
|
||||
'go-sdk': {
|
||||
build:
|
||||
'go build -o ./.conformance-server ./conformance/everything-server && go build -o ./.conformance-client ./conformance/everything-client',
|
||||
|
|
@ -54,14 +53,17 @@ export const KNOWN_SDKS: Record<string, SdkConfig> = {
|
|||
command: './.conformance-server -http=localhost:3000 -stateless=false',
|
||||
url: 'http://localhost:3000'
|
||||
},
|
||||
expectedFailures: 'conformance/baseline.yml'
|
||||
expectedFailures: 'conformance/baseline.yml',
|
||||
specOverrides: {
|
||||
'2026-07-28': {
|
||||
server: { command: './.conformance-server -http=localhost:3000' }
|
||||
}
|
||||
}
|
||||
},
|
||||
// main — targets the 2026-07-28 revision. Same uv workspace layout as v1.x
|
||||
// (client fixture in .github/actions/conformance/, mcp-everything-server
|
||||
// workspace package). Two baselines exist upstream: expected-failures.yml
|
||||
// covers runs at the latest dated spec (the default here), and
|
||||
// expected-failures.2026-07-28.yml covers --spec-version 2026-07-28 runs —
|
||||
// pass the latter via --expected-failures when targeting the new revision.
|
||||
// workspace package). Two baselines exist upstream, one per spec target;
|
||||
// the 2026-07-28 override picks the matching one.
|
||||
'python-sdk': {
|
||||
build: 'uv sync --frozen --all-extras --all-packages',
|
||||
client: {
|
||||
|
|
@ -71,7 +73,13 @@ export const KNOWN_SDKS: Record<string, SdkConfig> = {
|
|||
command: 'uv run --frozen mcp-everything-server --port 3000',
|
||||
url: 'http://localhost:3000/mcp'
|
||||
},
|
||||
expectedFailures: '.github/actions/conformance/expected-failures.yml'
|
||||
expectedFailures: '.github/actions/conformance/expected-failures.yml',
|
||||
specOverrides: {
|
||||
'2026-07-28': {
|
||||
expectedFailures:
|
||||
'.github/actions/conformance/expected-failures.2026-07-28.yml'
|
||||
}
|
||||
}
|
||||
},
|
||||
// v1.x — the stable, published line of the python-sdk, analogous to
|
||||
// typescript-sdk-v1. Clones the python-sdk repo, defaulting to the `v1.x`
|
||||
|
|
@ -96,6 +104,29 @@ export const KNOWN_SDKS: Record<string, SdkConfig> = {
|
|||
},
|
||||
expectedFailures: '.github/actions/conformance/expected-failures.yml'
|
||||
},
|
||||
// Fixtures live in conformance/ (the mcp-conformance package's
|
||||
// conformance-client + conformance-server bins; the package is excluded from
|
||||
// the workspace default-members, so build it explicitly). The server reads
|
||||
// PORT and STATELESS from the environment: the stateful (dated-spec)
|
||||
// lifecycle is the default, and the 2026-07-28 override sets STATELESS=1
|
||||
// for the SEP-2575 stateless lifecycle.
|
||||
'rust-sdk': {
|
||||
build: 'cargo build -p mcp-conformance',
|
||||
client: {
|
||||
command: './target/debug/conformance-client'
|
||||
},
|
||||
server: {
|
||||
command: 'PORT=3000 ./target/debug/conformance-server',
|
||||
url: 'http://localhost:3000/mcp'
|
||||
},
|
||||
specOverrides: {
|
||||
'2026-07-28': {
|
||||
server: {
|
||||
command: 'STATELESS=1 PORT=3000 ./target/debug/conformance-server'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// Fixtures live in tests/ModelContextProtocol.ConformanceClient and
|
||||
// tests/ModelContextProtocol.ConformanceServer (requires the .NET 10 SDK,
|
||||
// per global.json); build output goes to the repo-level artifacts/ tree
|
||||
|
|
@ -103,8 +134,8 @@ export const KNOWN_SDKS: Record<string, SdkConfig> = {
|
|||
// argument rather than reading MCP_CONFORMANCE_SCENARIO, so the command
|
||||
// bridges the env var into argv ($1 is the server URL the harness appends).
|
||||
// The server serves the stateful lifecycle at / and the SEP-2575 stateless
|
||||
// lifecycle at /stateless from the same port — for a 2026-07-28 run,
|
||||
// override with --server-url http://localhost:3000/stateless.
|
||||
// lifecycle at /stateless from the same port; the 2026-07-28 override
|
||||
// points runs at the stateless endpoint.
|
||||
'csharp-sdk': {
|
||||
build:
|
||||
'dotnet build tests/ModelContextProtocol.ConformanceClient -c Release -f net10.0 && dotnet build tests/ModelContextProtocol.ConformanceServer -c Release -f net10.0',
|
||||
|
|
@ -115,6 +146,11 @@ export const KNOWN_SDKS: Record<string, SdkConfig> = {
|
|||
command:
|
||||
'dotnet artifacts/bin/ModelContextProtocol.ConformanceServer/Release/net10.0/ModelContextProtocol.ConformanceServer.dll --urls http://localhost:3000',
|
||||
url: 'http://localhost:3000'
|
||||
},
|
||||
specOverrides: {
|
||||
'2026-07-28': {
|
||||
server: { url: 'http://localhost:3000/stateless' }
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue