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: add lint

Krrish Dholakiaa9dcb51d03df
diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py
index 6802a14fc47..2487260b615 100644
--- a/litellm/proxy/_experimental/mcp_server/server.py
+++ b/litellm/proxy/_experimental/mcp_server/server.py
@@ -425,7 +425,7 @@ if MCP_AVAILABLE:
continue
# Get server-specific auth header if available
- server_auth_header = None
+ server_auth_header: Optional[Union[Dict[str, str], str]] = None
if mcp_server_auth_headers and server.alias is not None:
server_auth_header = mcp_server_auth_headers.get(server.alias)
elif mcp_server_auth_headers and server.server_name is not None:
@@ -571,16 +571,16 @@ if MCP_AVAILABLE:
"litellm_logging_obj", None
)
if litellm_logging_obj:
- litellm_logging_obj.model_call_details[
- "mcp_tool_call_metadata"
- ] = standard_logging_mcp_tool_call
+ litellm_logging_obj.model_call_details["mcp_tool_call_metadata"] = (
+ standard_logging_mcp_tool_call
+ )
litellm_logging_obj.model = f"MCP: {name}"
# Try managed server tool first (pass the full prefixed name)
# Primary and recommended way to use MCP servers
#########################################################
- mcp_server: Optional[
- MCPServer
- ] = global_mcp_server_manager._get_mcp_server_from_tool_name(name)
+ mcp_server: Optional[MCPServer] = (
+ global_mcp_server_manager._get_mcp_server_from_tool_name(name)
+ )
if mcp_server:
standard_logging_mcp_tool_call["mcp_server_cost_info"] = (
mcp_server.mcp_info or {}