mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-25 06:54:19 +02:00
Add backwards compatibility support for MCP clients when connecting to SSE-only servers. When a StreamableHttpTransport receives a 405 Method Not Allowed error, the client now automatically falls back to SSETransport using the same URL and authentication settings. This implements the backwards compatibility requirement from the MCP specification: https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#backwards-compatibility Key changes: - Modified Client._context_manager() to detect 405 errors from StreamableHttpTransport - Automatically retry with SSETransport preserving auth, headers, and timeouts - Added comprehensive test coverage for fallback behavior - Non-405 HTTP errors are re-raised without fallback attempt Fixes #853 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: William Easton <strawgate@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| auth | ||
| transports | ||
| __init__.py | ||
| test_client.py | ||
| test_elicitation.py | ||
| test_logs.py | ||
| test_notifications.py | ||
| test_openapi_experimental.py | ||
| test_openapi_legacy.py | ||
| test_progress.py | ||
| test_roots.py | ||
| test_sampling.py | ||
| test_sse.py | ||
| test_stdio.py | ||
| test_streamable_http.py | ||