GeezerVison is showing github.com — mcpx server: legacy conformance — counter-offer on initialize, 2025-03-26 batches, no replies to notifications, sessions and error codes · Issue #1922 · developing-today/code
mcpx server: legacy conformance — counter-offer on initialize, 2025-03-26 batches, no replies to notifications, sessions and error codes #1922DescriptionRelocated from dezren39/darwin-nix#202 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).
Parent: #181
Summary
Legacy clients hit rules mcpx breaks. initialize with a version mcpx does not speak (2024-11-05, a future date, or 2026-07-28) is refused with -32022, a 2026-only code; every legacy revision says the server MUST counter-offer a version it supports. mcpx lists 2025-03-26 as supported but rejects JSON-RPC batches, which that revision says servers MUST receive. Unknown notifications get an error response, which JSON-RPC forbids. A refused initialize still mints a session; an unknown session is served statelessly instead of 404; an invalid MCP-Protocol-Version is accepted, and a valid one is ignored. -32602 is used for internal failures and for resource-not-found to every era (legacy expects -32002), upstream error codes survive only as text, and an undecodable cursor silently restarts at zero.
Found while writing the comparison register (pkgs/mcpx/docs/compare/) and checked against the code at 05c78b2. Each row below links its register entry, which carries the value, effort, risk, the specification text and every source.
Register rows
| row |
difference |
mcpx @ 05c78b2 |
effort |
| LV-05 |
Counter-offer for an older legacy version (2024-11-05) |
✗ — refused with -32022 instead of a counter-offer |
S |
| LV-06 |
Counter-offer for an unknown newer version |
✗ — 9999-01-01 refused; future dates count as modern |
S |
| LV-07 |
initialize asking for 2026-07-28 |
✗ — refused -32022, legacy list only; rule says counter-offer |
S |
| ERR-10 |
Code for refusing a legacy initialize: -32602 vs -32022 |
✗ — 2026-only -32022 sent to legacy peers |
S |
| TR-09 |
JSON-RPC batching |
✗ — server rejects batches; client splits HTTP, drops stdio |
M |
| SUB-18 |
A notification never gets a response |
✗ — unknown notifications answered with -32601 (wire S5) |
S |
| TR-05 |
stdio requests handled one at a time |
partial — only calls that may ask the client run concurrently |
M |
| TR-27 |
Mcp-Session-Id minted on a failed initialize |
✗ — issued even when the handshake is refused |
S |
| TR-28 |
Unknown or expired session id → 404 |
✗ — served statelessly as 2025-03-26 |
S |
| TR-35 |
Server uses the legacy header as the version |
partial — header ignored; no-session requests served as 2025-03-26 |
S |
| TR-36 |
Invalid legacy header value → 400 |
✗ — 1999-01-01 accepted and served |
S |
| ERR-04 |
-32602 Invalid params, meanings widening |
partial — also used for internal failures |
S |
| ERR-05 |
-32603 Internal error |
partial — MRTR path uses it; resources and prompts use -32602 |
S |
| ERR-06 |
-32002 Resource not found → -32602 |
partial — -32602 to every era; legacy expects -32002 |
S |
| ERR-16 |
Local errors versus peer errors through a proxy |
partial — upstream code and data survive only as text |
M |
| PG-03 |
invalid cursor SHOULD be -32602 |
✗ — undecodable cursor silently restarts at zero |
S |
Evidence
internal/mcpserver/server.go:844-859 (negotiate), :506-509; wire W1/W4/S1.
- Batches:
internal/mcpserver/server.go:1041-1044; wire W16, S3. 2025-03-26/basic/index.mdx:97.
- Notification replies:
internal/mcpserver/server.go:766; wire S5 (notifications/roots/list_changed, notifications/progress each answered -32601).
- Sessions:
internal/mcpserver/server.go:1208-1230.
In flight
PR #198 (open when this was filed) says it adds 2025-03-26 batches, never answering notifications, concurrent stdio requests, 404 for unknown sessions, and validation of the legacy MCP-Protocol-Version header: TR-09, SUB-18, TR-05, TR-28, TR-35, TR-36. Re-check those rows when it merges. The counter-offer, the error-code rows and the cursor are not in its description.
What to do
negotiate: counter-offer Latest for any well-formed legacy request mcpx does not speak; keep -32022 for _meta requests. If 2024-11-05 is to be served, add its floors rows at the same time (audio, tool annotations, completions).
- Accept batches from 2025-03-26 peers (or stop listing 2025-03-26).
- Never answer a message without an
id.
- Mint sessions only on a successful
initialize; 404 an unknown session; validate the legacy header and use it as the version when present.
-32002 to legacy peers for resource-not-found, -32603 for internal failures, pass upstream codes through, -32602 for a bad cursor.
Ease · Impact · Related
Ease M · Impact med · Related: #77, sibling issue for 2026 serving; docs/compare/conflicts.md C-02, C-03, C-09
Acceptance criteria
-
initialize with an unsupported version (older legacy, future, or 2026-07-28) counter-offers a version mcpx supports, per the legacy revisions — it is not refused with the 2026-only -32022.
- JSON-RPC batches from 2025-03-26 clients are received and answered per that revision; unknown notifications get no error response.
- A refused
initialize mints no session; an unknown session gets a 404 (not stateless service); MCP-Protocol-Version is validated and honoured.
- Error codes match the caller's era (resource-not-found is
-32002 for legacy), upstream error codes survive as codes (not only text), and an undecodable cursor errors instead of silently restarting at zero.
- Each register row in the issue is either fixed with a test or explicitly split out to a named follow-up issue; tests pass in CI.
Activitydeveloping-today commented on Oct 28, 2026 dezren39 commented on Oct 28, 2026 History carried over from dezren39/darwin-nix#202 (verbatim, oldest first):
@dezren39 · 2026-10-28T05:40:56Z
Intake review — fleet monitor
Liveness: Verified still live at intake: the issue is open and no merged PR closes it. Evidence caveat (same as the rest of this register batch): the filer's evidence was verified against 05c78b2 (2026-09-30) — re-verify against current main before fixing; if a row has since been fixed, say so on the issue and narrow the scope instead of redoing it.
Related: Parent tracker named in the issue body; sibling register-batch issues in dezren39/nix (the #209–#220 batch was enriched in the previous monitor run). mcpx also lives in developing-today/code — check for a code-side twin before assuming a nix-only fix.
Notes / risks: Server-side mirror of #203 (same parent #181): legacy clients against mcpx's server. Coordinate error-code era handling with #199/#200 so the modern path is not regressed by legacy fixes.
Suggested approach: Re-verify the cited code paths on current main, land failing tests for the acceptance criteria first, then the smallest fix that satisfies them.
🤖 Agent note · state: filed
- Agent: fleet monitor
- Session / ID: repo-fleet-monitor run 2026-10-28 00:20 CDT
- Found via: monitor reconciliation
- Task: Intake enrichment (§5 pass): acceptance criteria appended, labels normalized, this review posted.
- Expectation: effort/m as labelled; done = the acceptance criteria on the issue are met.
added bugSomething isn't working kind/bugSomething isn't working (prefixed form of the classic bug label) effort/mMedium: expected under 1 day of work meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo) on Oct 28, 2026dezren39 commented on Oct 29, 2026 🤖 Agent note · picked up — triage started
dezren39 commented on Oct 29, 2026 🤖 Agent note · done — triage verdict: ALREADY DONE — every register row verified implemented on current main; closing
- Agent: queue worker (repo-worker-code), Lane C shift
- Session / ID: queue task 2817 (triage)
- Found via: queue claim
- Verdict (fresh code reads at main c58507a, 2026-10-29): all 16 rows of this issue are implemented. The work landed with the dual-era protocol build-out (the in-flight PR the issue anticipated, plus the mcpx: serving 2026-07-28 to a conformant client — server/discover fields, serverInfo, cache hints, header checks and HTTP statuses #1916 server work). Per-row evidence:
- LV-05/06/07 + ERR-10 (counter-offer):
internal/mcpserver/server.go negotiate() — a legacy initialize asking for any version mcpx does not speak (older, future, or 2026-07-28) is answered with a counter-offer of Latest, per the legacy MUST; -32022 is kept only for modern _meta requests. The function's own comment records the old refusal as the bug it replaced.
- TR-09 (batches):
serveBatch/runBatch (transport.go, server.go ~L2139) receive and answer 2025-03-26 batches; a modern header gets a refusal, an empty batch an error.
- SUB-18 (notifications): stdio dispatch states and implements "Never a reply to a notification, not even an error" (server.go ~L1746);
notifications/initialized returns nil.
- TR-05 (stdio concurrency): "Every request runs on its own goroutine under its own context" (server.go ~L1688).
- TR-27 (session on failed initialize): covered by test —
transport_test.go:514 "a refused initialize must not mint a session".
- TR-28 (unknown session):
serveLegacy answers an unknown/expired session id with HTTP 404 "no such session; send initialize without Mcp-Session-Id to start one".
- TR-35/36 (legacy header):
serveLegacy validates MCP-Protocol-Version (invalid/unsupported/modern → 400 with the supported list) and sessionFor uses the header as the version for sessionless legacy requests (absent = 2025-03-26).
- ERR-04/05 (-32602 vs -32603):
codeInternal = -32603 is used for resources/prompts/backend failures (e.g. server.go ~L1095, with the comment recording the old -32602-for-everything behaviour); -32602 is reserved for client faults (bad params, missing arguments, bad cursor).
- ERR-06 (-32002):
notFound() is era-shaped: -32002 for legacy peers, -32602 for modern, URI in data (server.go ~L1173).
- ERR-16 (peer errors through the proxy):
internal/daemon/callerr.go — CallErrorBody.Upstream carries the upstream JSON-RPC error's code, message and data ("a pass-through's -32021 has to reach its client as -32021"), and routes_proto.go relays it.
- PG-03 (cursor):
page() errors on an undecodable cursor ("invalid cursor") instead of restarting at zero, surfaced as -32602 (server.go ~L2483).
- Dedupe: no other open code issue covers this subject; sibling mcpx: serving 2026-07-28 to a conformant client — server/discover fields, serverInfo, cache hints, header checks and HTTP statuses #1916 (2026 serving) is CLOSED and delivered its half.
- One stale artifact:
docs/compare/register/* still marks these rows ✗/partial at filing state (the same is true for most of mcpx client: cannot reach a conformant 2026-07-28 server #1918's rows). That is a register truth-up pass, recorded in the code backlog — it is not implementation work and does not keep this issue open.
- Action: closing as already done. No follow-up implementation packet — manufacturing one would be inventing work.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|