litellm/tests/test_litellm/responses
Cursor Agent 2a1983aa37 fix(mcp): forward x-mcp-auth headers during MCP tool list retrieval
Previously, _get_mcp_tools_from_manager() hardcoded mcp_auth_header=None
and mcp_server_auth_headers=None when calling _get_tools_from_mcp_servers().
This meant that x-mcp-auth and x-mcp-<server>-* headers from the HTTP
request were never forwarded during tool list fetching, causing MCP servers
that require authentication to fail with 424 (Failed Dependency).

The auth headers were already correctly forwarded for tool execution
(call_tool) but were missing from the tool discovery path.

Changes:
- _get_mcp_tools_from_manager: Accept and forward mcp_auth_header,
  mcp_server_auth_headers, oauth2_headers, raw_headers parameters
- _process_mcp_tools_without_openai_transform: Thread auth headers
  through to _get_mcp_tools_from_manager
- _process_mcp_tools_to_openai_format: Thread auth headers through
- aresponses_api_with_mcp (responses/main.py): Extract MCP auth headers
  from secret_fields BEFORE tool list retrieval, not just for auto-execute
- acompletion_with_mcp (chat_completions_handler.py): Same fix - extract
  headers early and pass to tool processing

Tests:
- test_get_mcp_tools_from_manager_forwards_auth_headers
- test_process_mcp_tools_without_openai_transform_forwards_auth_headers

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-02-28 03:30:16 +00:00
..
litellm_completion_transformation FIx: replace deprecated claude-3-7-sonnet-20250219 with claude-4-sonnet-20250514 2026-02-20 17:27:59 -08:00
mcp fix(mcp): forward x-mcp-auth headers during MCP tool list retrieval 2026-02-28 03:30:16 +00:00
test_metadata_codex_callback.py fix(tests): replace asyncio.sleep(1) with event-based wait in metadata callback tests (#21805) 2026-02-21 12:40:06 -08:00
test_no_duplicate_spend_logs.py fix(test): add timeout to flush() call to prevent 300s hang in CI (#21819) 2026-02-21 14:10:57 -08:00
test_null_test_fix.py Fix: Responses content can't be none 2026-01-14 12:13:18 +05:30
test_responses_api_request_body.py [Feat] Adds support for server-side compaction on the OpenAI Responses API context_management (#21058) 2026-02-12 10:00:30 -08:00
test_responses_utils.py Add test case 2026-02-20 16:22:44 +05:30
test_text_format_conversion.py Fix: test_text_format_to_text_conversion - properly mock handler to avoid API calls 2026-01-08 16:37:12 +05:30