mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
In a multi-worker Uvicorn setup, a client that reconnects to a different worker sends an mcp-session-id that the new worker has never seen. The MCP SDK returns 400 because the session is unknown. Fix: add _handle_stale_mcp_session() which inspects the inbound mcp-session-id header before the request reaches the SDK. If the session is not in this worker's _server_instances: - Non-DELETE: strip the header so the SDK creates a fresh session - DELETE: return 200 immediately (idempotent, session already gone) No new dependencies, no Redis, no latency added to the hot path. Fixes https://github.com/BerriAI/litellm/issues/20992 |
||
|---|---|---|
| .. | ||
| test_configs | ||
| conftest.py | ||
| mcp_server.py | ||
| test_aresponses_api_with_mcp.py | ||
| test_mcp_auth_header_extraction.py | ||
| test_mcp_auth_priority.py | ||
| test_mcp_chat_completions.py | ||
| test_mcp_client_unit.py | ||
| test_mcp_guardrails.py | ||
| test_mcp_hooks.py | ||
| test_mcp_litellm_client.py | ||
| test_mcp_logging.py | ||
| test_mcp_server.py | ||
| test_oauth2_mcp_config.yaml | ||
| test_openapi_spec_path_url.py | ||
| test_proxy_mcp_e2e.py | ||
| test_semantic_tool_filter_e2e.py | ||