Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: add oauth2_flow=client_credentials to MCPServer test helper

joereyna180e72d15d0a
diff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_oauth2_token_cache.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_oauth2_token_cache.py
index 55735dca98e..02b4ba6c993 100644
--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_oauth2_token_cache.py
+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_oauth2_token_cache.py
@@ -29,6 +29,7 @@ def _server(**overrides) -> MCPServer:
client_id="cid",
client_secret="csec",
token_url="https://auth.example.com/token",
+ oauth2_flow="client_credentials",
)
defaults.update(overrides)
return MCPServer(**defaults)
@@ -103,6 +104,7 @@ async def test_falls_back_to_static_token():
client_id=None,
client_secret=None,
token_url=None,
+ oauth2_flow=None,
authentication_token="static-tok-xyz",
)
result = await resolve_mcp_auth(server)
@@ -115,7 +117,7 @@ def test_needs_user_oauth_token_property():
assert _server().needs_user_oauth_token is False
# OAuth2 without credentials → needs per-user token
- assert _server(client_id=None, client_secret=None, token_url=None).needs_user_oauth_token is True
+ assert _server(client_id=None, client_secret=None, token_url=None, oauth2_flow=None).needs_user_oauth_token is True
# Non-OAuth2 → never needs user OAuth token
assert _server(auth_type=MCPAuth.bearer_token).needs_user_oauth_token is False