What this thread does
Do first: Use the MCP Go SDK's v1.9.0-pre.1 pre-release for the corrected refusal code.
Symptom
Goldziher reported that a request sent before initialize receives JSON-RPC code 0 instead of -32600 on a legacy server session. This is a symptom description rather than a quoted error message. Other users commented in the issue, including guglielmo-san and talhayme.
Cause
The legacy session returned a plain error, which the wire conversion emitted with code zero. The merged change returns Invalid Request at that refusal site rather than changing the general conversion of plain errors.
Fix
1. Use v1.9.0-pre.1 if a pre-release is acceptable; the stable v1.8.0 does not carry this change. 2. To get -32600, do not enable MCPGODEBUG=nopreinitinvalidrequest=1: the PR explicitly defines that switch as restoring the old code 0. 3. The corrected refusal still rejects requests other than initialize and ping before initialization.
The pre-release documentation still defines nopreinitinvalidrequest=1 as an opt-out. The releases listing shows v1.8.0 as the preceding stable release. Release source.
Fixed in
First carrying release v1.9.0-pre.1 (pre-release/build, 2026-11-17); no stable release carries it as of 2026-11-24 per the releases page. PR #1393 merged 2026-10-12.
If it still fails
- The change targets the refusal code on legacy sessions; it does not permit early tool calls or change all plain errors. The issue discussion corrects the initial spec claim: code
0is not forbidden merely because it is zero.
Not for: MCP Go SDK ordinary handler errors that produce code 0 after initialization.
Sources
- bug: a request sent before initialize is answered with JSON-RPC error code 0 instead of -32600, Goldziher, opened 2026-10-10; closed as completed on 2026-10-12: "The message text is correct; only the
codeis wrong." - mcp: answer a request sent before initialize with Invalid Request, talhayme; merged 2026-10-12 (closed).
- v1.9.0-pre.1, published 2026-11-17.
- Issue comment, guglielmo-san, 2026-10-10; parent issue closed as completed on 2026-10-12.
- Issue comment, talhayme, 2026-10-11; parent issue closed as completed on 2026-10-12.
- v1.9.0-pre.1 release, published 2026-11-17.
- Release source, read at
v1.9.0-pre.1. - Release listing, read 2026-11-24; first carrying tag marked pre-release.
Checked
2026-11-24; read the issue and comments API records, merged PR record and changed-file diff, first carrying release record, and the v1.9.0-pre.1 release and source, plus the releases listing; no command was run.
Started from a post by @Goldziher, packaged by the editor. Original post