Repository navigation
[P15] interop: matrix against the Go and Python SDKs - #356
Merged
Merged
Conversation
Adds an interop matrix that runs real clients and servers of the Swift, Go and Python MCP SDKs against each other, in both protocol eras, over Streamable HTTP and stdio. The matrix found two bugs in `HTTPClientTransport`, a connection-limit deadlock and requests that waited forever after their response stream ended. Both predate this work and are fixed earlier in the series. In the recorded run, the Swift SDK passes every cell in which it is the client or the server. The Python side is pinned by commit and installed from a lock with hashes; a cell whose client crashed or reported nothing counts as a failure.
- run-interop.sh: limit() forks and runs the command in its own process group; on expiry it sends TERM, then KILL, to the group and to every descendant, so a Go client (the Go runtime ignores SIGALRM) is stopped and a stdio client's server (Foundation's Process gives it a group of its own) does not survive. Exit status stays 142 on expiry and 128+signal otherwise; signals to the limit reach the command. - Python driver: an exception after connect but before the profile's checks finish is reported as a failed "battery" check with exit status 1, instead of being printed as shutdown noise with exit status 0. - report.py: an example client with a non-zero exit status is listed in the Failures table, so the report no longer says "No failures.". - The conformance server's build backend (hatchling and its dependencies) is pinned with hashes in the Python lock, and the git requirement is installed without build isolation or the index. - Go driver: concurrent-calls also fails on progress for unknown interop-c tokens, as the Swift driver does; the Python driver cannot observe such tokens, which a comment now says.
- The unsupported-version expectation of the connect profile passes only on -32022 or an error that says the protocol version is unsupported or not supported, in all three drivers. A substring match on "unsupported" also passed on, for example, HTTP 415 Unsupported Media Type. - session-expired passes only when the call recovers or fails with an error saying the session was not found, expired or terminated; any other error fails the check. The recorded outcomes of every SDK still pass. - cleanup also sends TERM to the children of each tracked process. A session cell's tracked PID is its subshell; its child, the limit, stops the client's process group and tree, so an aborted run no longer leaves the client running until the 300 s limit.
- The connect cells that negotiate against the Swift, Python and Go stateless servers expect 2026-07-28 (--expect-era stateless). Without an expectation, a fallback to the handshake against a server that serves 2026-07-28 still passed. - unknown-tool passes on an isError result or -32602 only, and unknown-resource on -32602 or -32002 only, in all three drivers. Any MCPError passed before, including -32000 and -32001, and the -32603 the HTTP transport synthesizes for HTTP 5xx and dropped streams, so a crashed server passed. The codes are the spec's (tools, resources error handling, 2025-11-25 and 2026-07-28); every SDK's server returns -32602 or an isError result in the recorded run. - The Python discover check sends server/discover with send_discover. In a pinned 2026-07-28 mode, discover() returns the locally synthesized result without a request. The Python and Swift checks also require a non-empty supportedVersions.
This was referenced Nov 25, 2026
Merged
Merged
Base automatically changed from
conformance/oauth-dpop-validation
to
rel/1.0.0
November 25, 2026 12:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rel/1.0.0in order (previous: P14 (#357) · next: P16 (#355))conformance/p15-interopconformance/oauth-dpop-validation(stacked: GitHub retargets this PR torel/1.0.0when the previous part merges)8864ff6interop: matrix against the Go and Python SDKs1abeca1interop: review fixes1d64122interop: second-pass review fixesb92b22dinterop: third-pass review fixesSummary
Adds an interop matrix that runs real clients and servers of the Swift, Go
and Python MCP SDKs against each other, in both protocol eras, over
Streamable HTTP and stdio. The matrix found two bugs in
HTTPClientTransport,a connection-limit deadlock and requests that waited forever after their
response stream ended. Both predate this work; their fix is in P1 (#370), with the
2026-07-28 rule in P4 (#367) and the documentation in P10 (#362). In the recorded run,
the Swift SDK passes every cell in which it is the client or the server. The
Python side is pinned by commit and installed from a lock with hashes; a cell
whose client crashed or reported nothing counts as a failure.
Motivation
The conformance harness checks the SDK against a mock peer. It does not show
whether the SDK works with other implementations, in particular with
concurrent traffic, cancellation, notifications, stream resumption, era
negotiation and server restarts. The Go and Python SDKs are the reference
implementations that Swift clients and servers will meet.
Changes
Matrix
scripts/run-interop.sh.build/interop/report.md;--update-resultscopies it tointerop/RESULTS.mdinterop/swift-client/mcp-interop-client(new executable targetMCPInteropClient): the check battery on the Swift SDKinterop/go-client/go.modpinsgithub.com/modelcontextprotocol/go-sdk v1.8.0and builds its conformance server and examples astooldependenciesinterop/python-client/requirements.inpinsmcp==2.3.0and the everything-server at thev2.3.0commit,requirements.txtis its lock with hashes,examples.sha256checks the example serversinterop/report.pyinterop/README.md,interop/RESULTS.mdThe SDK versions are pinned in files, so the matrix needs no local checkouts
of the other SDKs: Go modules come from the module proxy, the Python SDK is
installed into
.build/interop/py-venv.The three drivers take the same flags and print the same JSON lines. Check
profiles:
everything(report:basic)advancedMcp-Param-*headers (ASCII and non-ASCII), streaming elicitationconnectsessiontoolSwift fixture
conformance/everything-server:--stdiomode; the resource template istest://template/{id}/dataand the watched resourcetest://watched-resource, the names that the harness and the other SDKsuse.
Docs
docs/src/testing.src.md: an Interop section.CONTRIBUTING.md: how to runthe matrix.
README.src.md: theinterop/directory in the layout.docs/src/protocol.src.md,docs/src/troubleshooting.src.md: what thematrix showed about the other SDKs (the Go server keeps no events; the Go and
Python clients do not re-initialize an expired session either).
CLAUDE.md: an Interop section.Review fixes
Python pins (
interop/python-client/,scripts/run-interop.sh)v2.3.0tag, which can move, and the otherdependencies were resolved at install time.
requirements.in(new) pinsmcp==2.3.0and theserver to commit
2118f14f8a19bc158d8a1cf90af58d85d187f849.requirements.txtis now thelock with hashes generated from it (
uv pip compile --generate-hashes; the command is inrequirements.in), installed withuv pip sync --require-hashes; the git dependency isinstalled with
--no-deps. The venv is rebuilt when either file changes.from the same commit, are checked against
examples.sha256(new) before every run, and aredownloaded only when missing or changed; a mismatch after the download stops the run. Needs
sha256sumorshasum.Cell status (
scripts/run-interop.sh,interop/report.py)passed. Each cell writes its exit status to
<cell>.exit. The report adds a failedruncheck to a cell without a meta line, without checks, or whose client exited with an error
without reporting a failed check.
limitexited 0 when the client could not be started; it now fails with a message.Servers (
scripts/run-interop.sh)stops when one of the ports (3101, 3111, 3201, 3202, 3211, 3301, 3311, 8000) is in use, and
wait_forchecks that the process it started is alive when the URL answers.cells' clients were not tracked.
trackandreapkeep the list to live processes; thesession cells' clients are stopped on exit.
Report (
interop/report.py,interop/RESULTS.md)with only
|escaped.escapecollapses whitespace, escapes&,<,>as entities andMarkdown characters with a backslash; check names are no longer code spans. Missing keys in a
check line no longer raise.
RESULTS.mdregenerated: same rows and counts.Docs
interop/README.md: requirements, the fixed ports, when a cell fails, the pin files and howto update them,
UV_SYSTEM_CERTS=1behind a TLS-intercepting proxy.CLAUDE.md: the pinfiles.
Diagram
The matrix:
flowchart LR subgraph Clients SC[Swift driver] GC[Go driver] PC[Python driver] end subgraph Servers SS["Swift everything-server (HTTP, stdio)"] GS["Go everything-server (stateful, stateless, stdio)"] PS["Python everything-server (HTTP)"] EX["Example servers (hello, quickstart)"] end SC --> SS & GS & PS & EX GC --> SS & GS & PS & EX PC --> SS & GS & PS & EX Servers --> R["report.py: RESULTS.md"]API changes
None in the
MCPlibrary. New executable targetMCPInteropClient(
mcp-interop-client), not a product dependency ofMCP.Behavior changes
None in the
MCPlibrary.Results
interop/RESULTS.md: Swift SDK at the last change toSources/(the top ofP13 (#358)), Go
v1.8.0, Pythonv2.3.0. 105 client-server cells (45 basic,30 advanced, 15 connect, 15 session), 1569 checks, and four example clients.
tool-sampling,tool-elicitationmrtr-list-roots,mrtr-multiple-inputsInputRequestMap.UnmarshalJSONrequiresparamsreconnectionNo failure involves the Swift SDK. Without the P1 (#370) transport fix,
concurrent-inputdeadlocked andreconnectionwaited forever against serverswithout an event store.
Reports for the other SDKs' maintainers are prepared separately.
Conformance
Unchanged: tier score 100% for client and server at 2025-11-25 and
2026-07-28. Default baseline: 25 server entries (tasks extension), 0 client.
Tests
No library test changes; 860 swift-testing tests pass, plus XCTest.
Review notes
RESULTS.mdheader names the Swift SDK by the last commit that changedSources/, so the record stays valid while this branch and the next areamended.
(propose, get rejected, retry with a version from
supported) cannot bereached in the matrix; unit tests cover it.
test://watched-resource, soresource-updatedruns against Go servers only.
shutdown waits for idle keep-alive connections.
GitHub raw for the Python example servers). It is not wired into CI here;
P17 ([P17] ci: one job list for GitHub Actions and Linux at the desk #354) adds it, gated by
run-interop.sh --check.where the transport reads whole response bodies.
Verification
Every branch of the stack builds and passes
swift test; on this branch, 853 swift-testingtests plus XCTest. DocC builds with
--warnings-as-errors. All conformance legs pass at theirbaselines; the tier score is 100% for client and server at 2025-11-25 and 2026-07-28.
scripts/run-interop.sh --check(added in P17 (#354)) passes at the top of the stack.AI usage disclosure: the changes, the tests, the commit messages and this description were written with Claude Opus 5.5 and reviewed by the authors.