Should McpClient normalize JSON-RPC errors across stdio and Streamable HTTP #1847
Unanswered
chidozieononiwu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Pre-submission Checklist
Question Category
Your Question
We are adding Streamable HTTP coverage to the Azure MCP Server and found that unsupported MCP methods produce different client exceptions depending on transport when using C# MCP SDK 2.1.0:
stdio:
McpProtocolExceptionwithMcpErrorCode.MethodNotFoundStreamable HTTP:
HttpRequestExceptionwith HTTP 404The HTTP response appears to contain a valid JSON-RPC error envelope with error code
-32601. We understand that SEP-2575 mapsMethodNotFoundto HTTP 404, and that the client currently preserves most 404 responses asHttpRequestExceptionfor backward compatibility.Is this transport-dependent client behavior intentional and part of the expected public contract?
More generally:
Should callers catch both
McpProtocolExceptionandHttpRequestExceptionfor the same logical MCP error?Should a valid JSON-RPC error envelope take precedence over the HTTP status when choosing the client exception?
Is there a documented mapping of server errors to client exceptions for stdio and Streamable HTTP?
Which error scenarios are intentionally transport-specific?
This affects how we write transport-agnostic error handling and tests. We want to ensure that accommodating this case does not hide other incorrectly handled scenarios.
All reactions