fastmcp/tests
marvin-context-protocol[bot] 98edf1a05d Implement SSE fallback for 405 errors in MCP client
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>
2025-08-28 22:37:37 +00:00
..
cli Enhance inspect command with structured output and format options (#1481) 2025-08-26 10:39:28 -04:00
client Implement SSE fallback for 405 errors in MCP client 2025-08-28 22:37:37 +00:00
contrib Add comprehensive OAuth 2.1 authentication system with WorkOS integration (#1327) 2025-08-01 17:06:55 -04:00
deprecated feat: introduce fastmcp.json configuration system (#1517) 2025-08-19 16:06:04 -04:00
experimental Fallback to a Completions API when Sampling is not available (#1145) 2025-08-21 07:49:29 -04:00
integration_tests Add WorkOS and Azure OAuth providers (#1550) 2025-08-20 16:22:03 -04:00
prompts Add meta parameter support to tools, resources, templates, and prompts decorators (#1294) 2025-07-29 17:16:05 -04:00
resources Ensure resource + template names are properly prefixed when importing/mounting (#1423) 2025-08-08 21:29:07 -04:00
server Fix OAuth redirect URI validation for DCR compatibility (#1661) 2025-08-28 15:19:56 -04:00
tools PR Clean-up 2025-08-25 10:18:39 -05:00
utilities Enhance inspect command with structured output and format options (#1481) 2025-08-26 10:39:28 -04:00
__init__.py Update type handling for resources 2024-11-29 19:42:46 -05:00
conftest.py feat: introduce inline snapshots (#1605) 2025-08-25 10:08:55 -04:00
test_examples.py Fix single-element list unwrapping in tool content 2025-07-07 12:07:16 -04:00
test_mcp_config.py stdio client updates 2025-08-25 22:37:24 -05:00