mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
A request that explicitly asks for MCP tools via server_url litellm_proxy/... but resolves none of them (the API key/team has no access to the MCP server via allow_all_keys=false and no object-permission grant, the server name does not exist, or allowed_tools matches nothing) was silently sent to the model with no tools. The model then hallucinates, and the only trace is a list_mcp_tools spend log with status success and an empty response — the request looks healthy end to end while being completely broken. Raise a 400 BadRequestError naming the requested server URLs and the likely causes instead. Guard scope: - Mixed requests are exempt: with other (function) tools present, the request proceeds using those tools, matching the previous fallback behaviour. - Opt-out via litellm.reject_empty_mcp_resolved_tools = False (default True, per maintainer guidance). The auth-header pass-through test in tests/mcp_tests now resolves a dummy tool, since its purpose is header propagation, not zero-tool behaviour. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| 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_per_user_oauth_cache.py | ||
| test_proxy_mcp_e2e.py | ||
| test_semantic_tool_filter_e2e.py | ||