Handler-generated invalid params errors use HTTP 400 on the modern Streamable HTTP path
Maintainer antworten meist innerhalb von 3 Tagen
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Describe the bug
On the modern (2026-07-28) Streamable HTTP path, jsonrpc_http_status maps every ErrorCode::INVALID_PARAMS (-32602) response to HTTP 400. This includes ordinary application errors that the spec defines as -32602 and that are not transport validation failures:
resources/readfor a resource that does not exist (resources: Error Handling)prompts/getwith an unknown prompt name or a missing required argument (prompts: Error Handling)tools/callfor an unknown tool (tools: Error Handling)
The 2026-07-28 Streamable HTTP spec requires HTTP 400 only for HeaderMismatch, UnsupportedProtocolVersionError, and MissingRequiredClientCapabilityError, and HTTP 404 for -32601. Its backward-compatibility rules tell a client that receives HTTP 400 to inspect the body and fall back to initialize when it is not one of those recognized modern errors. A spec-compliant client could therefore treat a 400 carrying a "resource not found" -32602 as a legacy server and downgrade.
To Reproduce
- Implement a
ServerHandlerwhoseread_resourcereturnsErr(ErrorData::resource_not_found(...))(orErrorData::invalid_params(...)fromget_prompt/call_tool). - Send a valid modern Streamable HTTP request with protocol version
2026-07-28that reaches the handler. - Observe HTTP 400 with a JSON-RPC body containing error code
-32602.
Expected behavior
Handler-generated -32602 errors should be sent with HTTP 200 as in-band JSON-RPC errors, like other handler errors that jsonrpc_http_status does not map.
Logs
actual: HTTP 400, JSON-RPC error -32602 "Resource not found for URI: ui://widget/nope"
expected: HTTP 200, JSON-RPC error -32602
Found with rmcp 3.5.0 by MCPJam's modern-resource-not-found-invalid-params check (@mcpjam/sdk 8.20.1, profile [email protected]), which expects an in-band error. The official conformance suite (0.2.0-alpha.11) does not check the status code for this case.
Additional context
The mapping is in jsonrpc_http_status:
Transport-generated malformed-request errors, such as a missing protocolVersion in _meta, already build their HTTP 400 response directly in invalid_params_jsonrpc_response, so removing INVALID_PARAMS from this mapper should not change those responses.
#1303 is related. It makes malformed params for spec methods return -32602 instead of -32601, which fixes the 404, but with the current mapper those responses become HTTP 400.
- Vorherrschende Sprache
- Rust
- Sterne
- 4k
- Forks
- 654
- Ø Merge
- 4 T. 3 Std.
- Gemergte PRs (30 T.)
- 40
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/rust-sdk
-
P3 question T-documentation T-enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
modelcontextprotocol/rust-sdk#1155 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
LocalSessionManager session workers don't cancel in-flight tool calls on client disconnect (follow-up to #857)Evtl. vergeben @kkkhs hat das vor 1 Tag übernommen. Offenbug P1 ready for work T-transport
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
modelcontextprotocol/rust-sdk#1325 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
streamable-http server: client responses to server-initiated requests (sampling/elicitation/roots) are 202-accepted and silently discarded under the 2026-07-28 protocol — the pending request hangs foreverEvtl. vergeben @DaleSeo hat das vor 2 Tagen übernommen. Offenbug P1 ready for work T-transport
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
modelcontextprotocol/rust-sdk#1321 · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Bound pre-lifecycle bootstrap attempts in server initializationEvtl. vergeben @DaleSeo hat das vor 6 Tagen übernommen. Offenenhancement P2 T-service T-transport
modelcontextprotocol/rust-sdk#1315 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
ProgressDispatcher: a slow progress subscriber blocks subscribe() and delivery for other tokensEvtl. vergeben @monody0007 hat das vor 10 Tagen übernommen. Offenbug P1 ready for work T-handler
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
modelcontextprotocol/rust-sdk#1312 ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in modelcontextprotocol/rust-sdk
Ähnliche Issues
-
status:needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
agentic-os-org/ANOLISA#6742 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
Kc1t/alethe-agents#312 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
api: storage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
googleapis/google-cloud-rust#7153 ·
Maintainer antworten meist innerhalb von 1 Tag