fix: fix linting errors

This commit is contained in:
Krrish Dholakia 2025-09-28 17:45:04 -07:00
parent 208cd5fcb5
commit ba5cc5a5b3
3 changed files with 5 additions and 5 deletions

View file

@ -164,7 +164,7 @@ class MCPRequestHandler:
Returns:
Dict[str, Dict[str, str]]: Mapping of server alias to header dict
"""
server_auth_headers = {}
server_auth_headers: Dict[str, Dict[str, str]] = {}
prefix = "x-mcp-"
for header_name, header_value in headers.items():

View file

@ -729,7 +729,7 @@ class MCPServerManager:
)
# 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 mcp_server.alias:
server_auth_header = mcp_server_auth_headers.get(mcp_server.alias)
elif mcp_server_auth_headers and mcp_server.server_name:

View file

@ -1,5 +1,5 @@
import importlib
from typing import Dict, List, Optional
from typing import Dict, List, Optional, Union
from fastapi import APIRouter, Depends, Query, Request
@ -34,9 +34,9 @@ if MCP_AVAILABLE:
############ MCP Server REST API Routes #################
def _get_server_auth_header(
server,
mcp_server_auth_headers: Optional[Dict[str, str]],
mcp_server_auth_headers: Optional[Dict[str, Dict[str, str]]],
mcp_auth_header: Optional[str],
) -> Optional[str]:
) -> Optional[Union[Dict[str, str], str]]:
"""Helper function to get server-specific auth header with case-insensitive matching."""
if mcp_server_auth_headers and server.alias:
normalized_server_alias = server.alias.lower()