Skip to content

fix: fall back to SSE when AutoDetect probe gets 405 with JSON-RPC error body - #1849

Open
ump45nose wants to merge 1 commit into
modelcontextprotocol:mainfrom
ump45nose:contrib/213636541c56
Open

fix: fall back to SSE when AutoDetect probe gets 405 with JSON-RPC error body#1849
ump45nose wants to merge 1 commit into
modelcontextprotocol:mainfrom
ump45nose:contrib/213636541c56

Conversation

@ump45nose

Copy link
Copy Markdown

Summary

fix: fall back to SSE when AutoDetect probe gets 405 with JSON-RPC error body

Verification

dotnet test tests/ModelContextProtocol.Tests --framework net10.0 -c Release --filter 'FullyQualifiedNameHttpClientTransportAutoDetectTests' (10 passed); 'FullyQualifiedNameJuly2026ProtocolFallbackTests|FullyQualifiedName~HttpClientTransportTests' (34 passed)

Related to #1848

AI assistance disclosure: AI was used to discover this opportunity and draft the change or text. The submission was checked against the prepared artifact and recorded verification evidence.

…ror body

A 405 Method Not Allowed means the peer does not accept POST at the
endpoint, so a JSON-RPC body there is framework-generated rather than
evidence of Streamable HTTP support. Previously the SDK adopted
Streamable HTTP for any parsed JSON-RPC error, breaking connectivity to
SSE-only servers (e.g. gitmcp.io). Treat 405 like other non-JSON-RPC
failures and fall back to SSE, and add 405 to the initialize fallback
filter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant