litellm/tests
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
..
agent_tests [Fix] A2a Agent Gateway Fixes - A2A agents deployed with localhost/internal URLs in their agent cards (e.g., http://0.0.0.0:8001/) (#20604) 2026-02-06 15:02:34 -08:00
audio_tests [Feat] New provider TTS - Add AWS polly API for TTS (#18326) 2025-12-22 18:19:34 +05:30
basic_proxy_startup_tests Fix: remove merge markdown (#17586) 2025-12-06 05:38:16 -08:00
batches_tests fix(tests): fix flaky test_create_vertex_fine_tune_jobs_mocked - handle background Datadog flush (#21838) 2026-02-21 14:44:01 -08:00
code_coverage_tests Revert "[Feature] Add /public/supported_endpoints endpoint" 2026-02-26 17:21:43 -08:00
documentation_tests fix failing tests 2026-02-21 15:48:26 -08:00
enterprise remove orphan comment from test file 2026-02-26 16:51:18 -08:00
guardrails_tests Fix test_standard_logging_payload_includes_guardrail_information 2026-02-26 12:13:26 +05:30
image_gen_tests [Release - 02/10/2026] v1.81.10-nightly 2026-02-10 16:26:30 -08:00
litellm docs: update AssemblyAI docs with Universal-3 Pro, Speech Understanding, and LLM Gateway (#21130) 2026-02-27 17:24:48 -08:00
litellm-proxy-extras fix: resolve 'does not exist' migration errors as applied in setup_database (#19281) 2026-01-26 22:11:36 -08:00
litellm_core_utils Fix: empty assistant message for converse API 2026-02-04 09:50:58 +05:30
litellm_utils_tests Fix test_perform_health_check_filters_by_model_id 2026-02-26 10:43:05 +05:30
llm_responses_api_testing Fix anthropic responses 2026-02-20 17:30:42 -08:00
llm_translation Preserve forwarding server side called tools 2026-02-27 11:31:45 +05:30
load_tests Add memory leak detection tests with CI integration (#18881) 2026-01-09 17:36:10 -08:00
local_testing Restore 2026-02-26 13:31:37 -08:00
logging_callback_tests Merge pull request #22180 from BerriAI/litellm_fix_vllm_test 2026-02-26 18:43:52 +05:30
mcp_tests fix(mcp): update test mocks to use renamed filter_server_ids_by_ip_with_info 2026-02-27 22:37:05 -03:00
multi_instance_e2e_tests
ocr_tests OCR test fixes 2026-01-11 08:00:31 -08:00
old_proxy_tests/tests remove prompt caching headers as the support has been removed 2026-01-02 11:08:35 +05:30
openai_endpoints_tests Fix: Managed Batches: Inconsistent State Management for list and cancel batches 2026-02-03 14:47:28 +05:30
otel_tests test fix 2026-01-31 19:08:07 -08:00
pass_through_tests FIx: replace deprecated claude-3-7-sonnet-20250219 with claude-4-sonnet-20250514 2026-02-20 17:27:59 -08:00
pass_through_unit_tests Fix test_pass_through_request_logging_failure 2026-02-26 10:50:05 +05:30
proxy_admin_ui_tests security: fix critical/high CVEs in OS-level libs and NPM transitive 2026-02-24 19:40:09 +05:30
proxy_e2e_anthropic_messages_tests Fix: litellm/tests/llm_responses_api_testing/test_anthropic_responses_api.py 2026-02-20 17:30:53 -08:00
proxy_security_tests
proxy_unit_tests [Fix] Include created_at and updated_at in /project/list response 2026-02-27 15:41:03 -08:00
router_unit_tests Merge pull request #20593 from ryan-crabbe/perf/reuse-litellm-params 2026-02-21 12:11:02 -08:00
scim_tests
search_tests Add duckcukgo in model map 2026-02-18 16:13:20 +05:30
spend_tracking_tests increasing time for spend tracking 2026-01-20 16:31:25 -08:00
store_model_in_db_tests fix: test mock 2026-01-02 17:38:52 +09:00
test_litellm fix(mcp): forward x-mcp-auth headers during MCP tool list retrieval 2026-02-28 03:30:16 +00:00
unified_google_tests Revert "[Infra] Changing Google Tests to use Gemini 3 Flash Preview" 2026-01-20 17:32:10 -08:00
vector_store_tests Add support for vertex ai for rag/ingest 2026-02-13 20:11:10 +05:30
windows_tests
__init__.py
gettysburg.wav
large_text.py
openai_batch_completions.jsonl
README.MD
test_budget_management.py
test_callbacks_on_proxy.py Fix CI: Revert security scan changes and add GitGuardian ignore rules (#18358) 2025-12-22 17:03:53 -08:00
test_config.py
test_debug_warning.py
test_default_encoding_non_root.py fix: resolve Read-only file system error in non-root images (#19449) 2026-01-20 19:00:52 -08:00
test_end_users.py
test_entrypoint.py
test_fallbacks.py Revert "fix: prevent error when max_fallbacks exceeds available models (#20071)" 2026-02-03 15:15:30 +05:30
test_gpt5_azure_temperature_support.py
test_health.py
test_keys.py Adding retries to flaky tests 2026-01-22 15:21:44 -08:00
test_litellm_proxy_responses_config.py
test_logging.conf
test_models.py
test_openai_endpoints.py
test_organizations.py Adding retries to flaky tests 2026-01-22 15:21:44 -08:00
test_otel_thread_leak.py Fix thread leak in OpenTelemetry dynamic header path (#19946) 2026-01-28 10:35:37 -08:00
test_passthrough_endpoints.py
test_presidio_latency.py fix(presidio): reuse HTTP connections to prevent OOMs (#19964) 2026-01-28 16:08:53 -08:00
test_proxy_server_non_root.py deactivating non root tests 2026-01-23 22:55:36 -08:00
test_ratelimit.py test_async_rate_limit 2025-11-15 10:34:24 -08:00
test_resource_cleanup.py
test_service_logger_otel.py fix(langfuse_otel): prevent empty proxy request spans from being sent to Langfuse 2026-01-28 15:35:35 +01:00
test_spend_logs.py Fix CI: Revert security scan changes and add GitGuardian ignore rules (#18358) 2025-12-22 17:03:53 -08:00
test_team.py fix(test): skip 'projects' field in team update assertion (#21777) 2026-02-21 10:24:53 -08:00
test_team_logging.py
test_team_members.py
test_users.py fix(tests): update deprecated Anthropic model in test_user_model_access (#21826) 2026-02-21 14:18:24 -08:00

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.