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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
style: apply black formatting
Ryan Crabbe09113078c02c
diff --git a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py b/litellm/proxy/_experimental/mcp_server/rest_endpoints.pyindex f1030bf0a8a..3047fb73325 100644--- a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py+++ b/litellm/proxy/_experimental/mcp_server/rest_endpoints.py@@ -317,9 +317,11 @@ if MCP_AVAILABLE:):# Dict keys may be server_ids OR names/aliases; normalize so lookup# by concrete server_id resolves name-keyed restrictions too.- allowed_tools_for_server = global_mcp_server_manager.expand_tool_permissions(- user_api_key_auth.object_permission.mcp_tool_permissions- ).get(server.server_id)+ allowed_tools_for_server = (+ global_mcp_server_manager.expand_tool_permissions(+ user_api_key_auth.object_permission.mcp_tool_permissions+ ).get(server.server_id)+ )if (allowed_tools_for_server is not Noneand len(allowed_tools_for_server) > 0diff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.pyindex 6ac2b0ac4fa..447c28078ec 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py@@ -2673,7 +2673,9 @@ class TestMCPServerManagerExpandPermissionList:def test_searches_config_and_registry_union(self):manager = MCPServerManager()- manager.config_mcp_servers["cfg-id"] = self._make_server("cfg-id", server_name="a")+ manager.config_mcp_servers["cfg-id"] = self._make_server(+ "cfg-id", server_name="a"+ )manager.registry["reg-id"] = self._make_server("reg-id", server_name="b")assert manager.expand_permission_list(["a"]) == ["cfg-id"]