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 pydantic import error

Ishaan Jaff5017332690d3
diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py
index 29041eab97c..b9820fb41e3 100644
--- a/litellm/proxy/_experimental/mcp_server/server.py
+++ b/litellm/proxy/_experimental/mcp_server/server.py
@@ -3,6 +3,7 @@ LiteLLM MCP Server Routes
"""
import asyncio
+from typing import Any, Dict
import mcp.types as types
from anyio import BrokenResourceError
@@ -16,7 +17,6 @@ from litellm._logging import verbose_logger
from litellm.proxy._experimental.mcp_server.tool_registry import (
global_mcp_tool_registry,
)
-from litellm.types.mcp_server.tool_registry import *
from .sse_transport import SseServerTransport
@@ -55,7 +55,7 @@ async def list_tools() -> list[types.Tool]:
@server.call_tool()
async def handle_call_tool(
- name: str, arguments: dict | None
+ name: str, arguments: Dict[str, Any] | None
) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
"""
Call a specific tool with the provided arguments
diff --git a/litellm/types/mcp_server/tool_registry.py b/litellm/types/mcp_server/tool_registry.py
index 9ff06ec3514..f2c1cf1a30b 100644
--- a/litellm/types/mcp_server/tool_registry.py
+++ b/litellm/types/mcp_server/tool_registry.py
@@ -9,6 +9,9 @@ class MCPTool(BaseModel):
input_schema: Dict[str, Any]
handler: Callable
+ class Config:
+ arbitrary_types_allowed = True
+
class ToolSchema(BaseModel):
name: str