You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(mcp): JSON-RPC spec compliance — flexible id, correct notification format
- McpRequest.id is now Option<u64> with skip_serializing_if, so
notifications omit the id field as required by JSON-RPC 2.0 spec.
Previously sent id: 0 which violates the spec.
- McpResponse.id uses flexible deserialization that accepts number,
string, or null — fixes interop with non-standard MCP servers that
return string ids or missing id fields on error responses.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix review feedback: remove serde(default) from McpResponse.id, fix test assertions
- Remove #[serde(default)] from McpResponse.id so notifications (no id field)
don't incorrectly parse as responses — prevents DoS/spoofing via SSE
- Update test assertions to use Some(value) after id became Option<u64>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: update new transport files for Option<u64> id after rebase
Upstream #721 added stdio/unix/transport modules that use McpRequest.id
and McpResponse.id as u64. After our rebase (which changes id to
Option<u64>), these need .unwrap_or(0) for HashMap keys and Some()
wrapping in tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add regression tests for JSON-RPC spec compliance
Tests for notification serialization without id field,
flexible id deserialization (string, null, non-numeric).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments