mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 14:34:17 +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> |
||
|---|---|---|
| .. | ||
| cli | ||
| client | ||
| contrib | ||
| deprecated | ||
| experimental | ||
| integration_tests | ||
| prompts | ||
| resources | ||
| server | ||
| tools | ||
| utilities | ||
| __init__.py | ||
| conftest.py | ||
| test_examples.py | ||
| test_mcp_config.py | ||