diff --git a/litellm/proxy/_experimental/mcp_server/mcp_trust_scoring.py b/litellm/proxy/_experimental/mcp_server/mcp_trust_scoring.py index 1dc9c3d15c3..474973ce964 100644 --- a/litellm/proxy/_experimental/mcp_server/mcp_trust_scoring.py +++ b/litellm/proxy/_experimental/mcp_server/mcp_trust_scoring.py @@ -162,8 +162,6 @@ def normalize_trust_score(raw_score: object) -> Optional[float]: score = float(raw_score) if score < 0: return None - if score <= 1.0: - return score return min(score / 100.0, 1.0) diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yaml index 48752711541..f142d95f0b3 100644 --- a/litellm/proxy/proxy_config.yaml +++ b/litellm/proxy/proxy_config.yaml @@ -62,7 +62,7 @@ litellm_settings: similarity_threshold: 0.3 mcp_trust_scoring: - enabled: true + enabled: false min_trust_score: 0.5 cache_ttl_seconds: 3600 fail_open: true diff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_trust_scoring.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_trust_scoring.py index 8e924e78612..202929d2c5a 100644 --- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_trust_scoring.py +++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_trust_scoring.py @@ -109,11 +109,14 @@ def _isolated_client( ) -def test_normalize_trust_score_accepts_fraction_and_percent() -> None: - assert normalize_trust_score(0.85) == 0.85 +def test_normalize_trust_score_maps_do_percent_scale_to_fraction() -> None: + assert normalize_trust_score(85) == 0.85 normalized = normalize_trust_score(92.5) assert normalized is not None assert abs(normalized - 0.925) < 1e-9 + low_trust = normalize_trust_score(1.0) + assert low_trust is not None + assert abs(low_trust - 0.01) < 1e-9 def test_parse_trust_response_found_server() -> None: