Skip to content
Discussion options

You must be logged in to vote

For C# SDK 2.1.0, the behavior you observed matches the current implementation, but it is an SDK compatibility choice rather than a transport-independent MCP contract.

StreamableHttpClientSessionTransport converts a parsed JSON-RPC error to McpProtocolException only when either:

  • the HTTP status is 400; or
  • the error code is one of the 2026 per-request metadata errors (HeaderMismatch, MissingRequiredClientCapability, or UnsupportedProtocolVersion).

Every other non-success status—including a 404 carrying -32601 MethodNotFound—continues through EnsureSuccessStatusCode... and becomes HttpRequestException. The source comment says this preserves compatibility with transport-level 404 behavior:
h…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chidozieononiwu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants