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
test install on python 3.8
Ishaan Jafferb2747211c840
diff --git a/litellm/proxy/_experimental/mcp_server/tool_registry.py b/litellm/proxy/_experimental/mcp_server/tool_registry.pyindex bc69095fc43..58570aafadf 100644--- a/litellm/proxy/_experimental/mcp_server/tool_registry.py+++ b/litellm/proxy/_experimental/mcp_server/tool_registry.py@@ -1,12 +1,18 @@import json-from typing import Any, Callable, Dict, List, Optional--from mcp.types import Tool as MCPToolSDKTool+from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optionalfrom litellm._logging import verbose_loggerfrom litellm.proxy.types_utils.utils import get_instance_fnfrom litellm.types.mcp_server.tool_registry import MCPTool+if TYPE_CHECKING:+ from mcp.types import Tool as MCPToolSDKTool+else:+ try:+ from mcp.types import Tool as MCPToolSDKTool+ except ImportError:+ MCPToolSDKTool = None # type: ignore+class MCPToolRegistry:"""@@ -55,7 +61,11 @@ class MCPToolRegistry:def convert_tools_to_mcp_sdk_tool_type(self, tools: List[MCPTool]- ) -> List[MCPToolSDKTool]:+ ) -> List["MCPToolSDKTool"]:+ if MCPToolSDKTool is None:+ raise ImportError(+ "MCP SDK is not installed. Please install it with: pip install 'litellm[proxy]'"+ )return [MCPToolSDKTool(name=tool.name,