Handler-generated invalid params errors use HTTP 400 on the modern Streamable HTTP path
Los mantenedores suelen responder en 3 días
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 4k
- Forks
- 654
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 40
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modelcontextprotocol/rust-sdk
-
P3 question T-documentation T-enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
modelcontextprotocol/rust-sdk#1155 ·
Los mantenedores suelen responder en 3 días
-
bug P1 ready for work T-transport
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
modelcontextprotocol/rust-sdk#1325 ·
Los mantenedores suelen responder en 3 días
-
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 foreverPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug P1 ready for work T-transport
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
modelcontextprotocol/rust-sdk#1321 ·
Los mantenedores suelen responder en 3 días
-
Bound pre-lifecycle bootstrap attempts in server initializationPosiblemente ocupada @DaleSeo la tomó hace 4 días. Abiertoenhancement P2 T-service T-transport
modelcontextprotocol/rust-sdk#1315 · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
ProgressDispatcher: a slow progress subscriber blocks subscribe() and delivery for other tokensAbiertobug P1 ready for work T-handler
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
modelcontextprotocol/rust-sdk#1312 ·
Los mantenedores suelen responder en 3 días
Todos los issues de modelcontextprotocol/rust-sdk
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
tauri-apps/tauri#16219 ·
Los mantenedores suelen responder en 2 días
-
state:triage-needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
ktuner keeps a stale ledger path and can never restore that entryPosiblemente ocupada @Frun1na la tomó hoy. Abiertocomponent:ktuner
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
agentic-os-org/ANOLISA#6483 · 1 comentario ·
Los mantenedores suelen responder en 1 día