Handler-generated invalid params errors use HTTP 400 on the modern Streamable HTTP path
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 4k
- Fork
- 654
- Merge trung bình
- 4 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/rust-sdk
-
P3 question T-documentation T-enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
modelcontextprotocol/rust-sdk#1155 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
LocalSessionManager session workers don't cancel in-flight tool calls on client disconnect (follow-up to #857)Có thể đã có người làm @kkkhs đã nhận 1 ngày trước. Đang mởbug P1 ready for work T-transport
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
modelcontextprotocol/rust-sdk#1325 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
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 foreverCó thể đã có người làm @DaleSeo đã nhận 2 ngày trước. Đang mởbug P1 ready for work T-transport
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
modelcontextprotocol/rust-sdk#1321 · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Bound pre-lifecycle bootstrap attempts in server initializationCó thể đã có người làm @DaleSeo đã nhận 6 ngày trước. Đang mởenhancement P2 T-service T-transport
modelcontextprotocol/rust-sdk#1315 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
ProgressDispatcher: a slow progress subscriber blocks subscribe() and delivery for other tokensCó thể đã có người làm @monody0007 đã nhận 9 ngày trước. Đang mởbug P1 ready for work T-handler
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
modelcontextprotocol/rust-sdk#1312 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của modelcontextprotocol/rust-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agentic-os-org/ANOLISA#6742 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
api: storage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
googleapis/google-cloud-rust#7153 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
comp-mysql
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ClickHouse/ClickHouse#124749 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
oracle/rust-oracledb#43 · 1 bình luận ·