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 importorskip guard and add LiteLLM_TeamTableCachedObj import

yuneng-jiang700fd86de971
diff --git a/litellm/proxy/management_endpoints/mcp_management_endpoints.py b/litellm/proxy/management_endpoints/mcp_management_endpoints.py
index e137ad15f1b..8c8bd629884 100644
--- a/litellm/proxy/management_endpoints/mcp_management_endpoints.py
+++ b/litellm/proxy/management_endpoints/mcp_management_endpoints.py
@@ -112,6 +112,7 @@ if MCP_AVAILABLE:
)
from litellm.proxy._types import (
LiteLLM_MCPServerTable,
+ LiteLLM_TeamTableCachedObj,
LitellmUserRoles,
MakeMCPServersPublicRequest,
MCPApprovalStatus,
@@ -147,7 +148,7 @@ if MCP_AVAILABLE:
user_api_key_dict: UserAPIKeyAuth,
team_id: Optional[str] = None,
server_id: Optional[str] = None,
- ) -> Tuple[str, "LiteLLM_TeamTableCachedObj"]:
+ ) -> Tuple[str, LiteLLM_TeamTableCachedObj]:
"""
Verify that the caller is an MCP server manager for a team and (for edit/delete)
that the target server belongs to that team.
@@ -206,7 +207,7 @@ if MCP_AVAILABLE:
async def _auto_assign_mcp_server_to_team(
server_id: str,
team_id: str,
- team_obj: "LiteLLM_TeamTableCachedObj",
+ team_obj: LiteLLM_TeamTableCachedObj,
prisma_client: Any,
) -> None:
"""
@@ -245,7 +246,7 @@ if MCP_AVAILABLE:
async def _remove_mcp_server_from_team(
server_id: str,
- team_obj: "LiteLLM_TeamTableCachedObj",
+ team_obj: LiteLLM_TeamTableCachedObj,
) -> None:
"""Remove a server ID from a team's ObjectPermissionTable.mcp_servers list."""
from litellm.proxy.proxy_server import prisma_client
diff --git a/tests/test_litellm/proxy/management_endpoints/test_mcp_manager_role.py b/tests/test_litellm/proxy/management_endpoints/test_mcp_manager_role.py
index 36cecde65b9..86b0419fb22 100644
--- a/tests/test_litellm/proxy/management_endpoints/test_mcp_manager_role.py
+++ b/tests/test_litellm/proxy/management_endpoints/test_mcp_manager_role.py
@@ -1,5 +1,7 @@
import pytest
+pytest.importorskip("mcp", reason="mcp package not installed")
+
from litellm.proxy._types import (
LiteLLM_TeamTable,
LitellmUserRoles,