litellm/tests/unit/responses/mcp
mateo-berri 3729e66103 fix(mcp): let a forced hosted MCP choice follow its tool under drop_params
A forced `mcp` tool_choice under drop_params is now dropped only on routes whose config drops hosted MCP tools, and it is dropped together with that tool. Each chat config reports this through `hosted_mcp_tool_handling(model)` as "drops", "runs" or "forwards", and the drop helper reads the same value, so the two cannot drift apart. Routes that forward hosted MCP tools, such as OpenRouter, xAI, Groq and Mistral, keep the merge base's 400 whatever drop_params says, so nothing reaches the provider. OCI and Ollama now report "drops", which matches how their transformations already treat the tools. On OCI a forced `mcp` choice used to fail with an OCIError and now drops with its tool

The 400 now names the one cause that applies: drop_params is off, the request sent no tool for that server, the tool_choice names no server, the provider runs hosted MCP itself, or the route forwards hosted MCP tools. A forced LiteLLM MCP gateway server now gets its own 400 on every route, before any tool listing or model call. Batch rows and real-time calls use the same text

When the saved toolset read fails in block mode, the mcp_security guardrail now answers 503 with a try-again message and keeps `unverified_servers`. A server that is known to be unregistered still gets the policy 400. Alert mode is unchanged

Uploads that name no model now apply `router_settings.default_litellm_params.drop_params`, with the batch row value and a `files_settings` drop_params still winning. The batch remedy no longer limits the router default to uploads that name a model, and its row wording is now true for any value that does not turn dropping on, such as "no" or 0

(cherry picked from commit dc04b04072)
2026-11-22 01:20:58 -08:00
..
__init__.py ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests (#42904) 2026-09-24 23:07:48 +00:00
conftest.py perf(ci): isolate and shard integration suites (#44146) 2026-10-10 11:15:19 -07:00
test_aresponses_api_with_mcp.py fix(mcp): let a forced hosted MCP choice follow its tool under drop_params 2026-11-22 01:20:58 -08:00
test_chat_completions_handler.py fix(mcp): let a forced hosted MCP choice follow its tool under drop_params 2026-11-22 01:20:58 -08:00
test_litellm_proxy_mcp_handler.py test(mcp): use the LTS MCP manager path 2026-11-14 02:52:48 +00:00
test_mcp_streaming_iterator.py fix(responses): keep every MCP tool round in streaming follow-up input (#47698) 2026-11-11 14:40:38 -08:00
test_tool_precheck.py fix(sdk): backport #45961 to lts/1.108.x 2026-11-07 17:55:52 -08:00