chadtmiller.com/monolith
An atproto PDS
0
0
MCP: legacy clients too, 2025-11-25 and 2025-06-18, beside 2026-07-28
Merged Approved
This makes /mcp serve legacy clients (2025-11-25 and 2025-06-18) statelessly, beside 2026-07-28. initialize answers the handshake with no session. legacy serves ping, tools/list and tools/call. modern is the old path.
- Spec:
spec/COMMANDS.mdstates the dual-era behaviour and its checks, and the vendored legacy pages are in place. The README describes what is built, not how it came to be built. - Server: the code follows the spec: the handshake, the 202 for notifications,
-32601for other methods, and the three versions insupportedVersionsandsupported.mcp.rsadds no crates. - Harness: the new checks are strict. They compare against the spec where the reference can't say. The schemas are per revision, with draft-07 handled for 2025-06-18, and tool calls go in a random era drawn from the seeded
random.mjs. Nothing is loosened. conformance.yaml: the one excused check,sep-2575-http-server-method-not-found-404-initialize, gives a reason that matches what that check tests.
I read every changed file except the vendored spec/mcp/legacy/** pages and schemas. I only confirmed they are added as spec material, since they are copies of upstream.
I did not run the code.
Merged as 359c699
/mcpnow serves MCP clients that open withinitialize, as most clients still do (2025-11-25 and 2025-06-18), beside the stateless 2026-07-28 it already spoke. Until now such a client got "Unsupported protocol version" and could not connect at all.Claude Opus 5.5 · high
What changes
Spec.
spec/mcp/legacy/2025-11-25/and2025-06-18/vendor the pages a legacy endpoint rests on, from modelcontextprotocol/modelcontextprotocol: lifecycle, transports, basic, ping, tools, changelog andschema.json.spec/COMMANDS.md's "The MCP endpoint" makes the endpoint dual-era, asmcp/basic/versioning.mdallows:_meta's version is modern, as before.initializeanswers the version asked if served, else2025-11-25, with the tools capability and the same identity and instructions asserver/discover. No session.MCP-Protocol-Versionand getping,tools/listandtools/callin that revision's shape. Notifications are202; other methods are-32601.2025-03-26: a request with no version anywhere is refused-32020.GETandDELETEare405.supportedVersionsandUnsupportedProtocolVersionError.supportedname all three.Harness.
lib/via.mjs: every--commandstool call goes in a random era, and each message is validated against its revision's schema. 2025-06-18's is draft-07, so it gets an Ajv of its own.checks/commands.mjs, for each legacy revision:initializewith and without the header must give that version, the tools capability, the identity and instructions, and noMCP-Session-Id;notifications/initializedmust be202with no body, andpingmust be{};tools/listmust give the modern era's tools exactly;-32602, andserver/discovermust be-32601.For both eras: no version must be
-32020;2025-03-26must be-32022with the three versions;initializefor2025-03-26or1999-01-01must give2025-11-25;GETandDELETEmust be405.conformance.mjsalso runs the suite's legacy scenarios at 2025-11-25:server-initialize,server-session-lifecycle,ping,tools-listanddns-rebinding-protection.conformance.yamllists the one modern check that no longer applies:sep-2575-http-server-method-not-found-404-initialize, whose own text holds only a server that does not implementinitialize.runCliclearsPDS_ADMIN_PASSWORDas it doesPDS_TOKEN. A shell that had one set made--commandsfail with 401s.Server. In
mcp.rs,requestpicks the era:initializeanswers the handshake.legacyserves the post-handshake methods statelessly, with no session state.modernis the old path, its supported lists now naming three versions.call_toolanswers(content, is_error), which each era wraps in its own result shape.Why
The endpoint was usable only from clients already on 2026-07-28, and a smoke test against
just devshowed the 2025 handshake refused. A dual-era endpoint is what the MCP spec prescribes for this. Stateless legacy, with no session ids, keeps the server holding nothing per client and keeps any instance able to answer any request.How it was checked
server/discover's supportedVersions, and the suite'sserver-initialize,server-session-lifecycleandping.initializeanswering2025-11-25whatever was asked.--commandsfails atMCP initialize (2025-06-18). The suite's scenarios, which ask for 2025-11-25, pass, which is why the harness's own check is there. Put back.compare.mjs --steps 400 --seed 31 --commandsagrees, with tool calls in all three eras;conformance.mjspasses all 10 scenarios;cargo test -p pds-server mcp::passes, and clippy is clean;just quickpasses here.just dev, lists the tools, calls them with a token and pings.just gatesis left to the pull'sgatesworkflow.Shortcomings
2025-03-26clients: they send no version header, and that revision requires accepting JSON-RPC batches.