mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-20 00:11:50 +00:00
/v1/mcp/server returns as soon as the DB row is written, but the gateway runs the initialize + tools/list handshake against the upstream lazily, on the first request that needs it. Every MCP test read tools/list immediately after registering, so it raced that handshake. The gateway reports a server it has not discovered yet exactly like a dead one: it catches the per-server handshake exception and returns an empty tool list. The tests asserted on a single read, so the race surfaced as "granted key never saw search_datadog_logs; tools=frozenset()" while a sibling test against the same upstream in the same run passed. Add McpClient.await_tool, which polls tools/list to the suite's existing poll_timeout and returns the qualified tool name, and route the four discovery sites through it. An unreachable upstream or an unapplied grant still fails, and the failure now names the last tools/list result. Refs LIT-4821 |
||
|---|---|---|
| .. | ||
| conftest.py | ||
| datadog_mcp.py | ||
| linear_session_capture.py | ||
| mcp_client.py | ||
| oauth_chat_client.py | ||
| test_mcp_access_group_e2e.py | ||
| test_mcp_chat_completion_oauth_e2e.py | ||
| test_mcp_datadog_e2e.py | ||
| test_mcp_guardrail_e2e.py | ||
| test_mcp_key_access_e2e.py | ||