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 access control to register endpoint to match authorize and token

Yuneng Jiangb6de470ce97d
diff --git a/litellm/proxy/management_endpoints/mcp_management_endpoints.py b/litellm/proxy/management_endpoints/mcp_management_endpoints.py
index 8e54af0f96a..f18e699045f 100644
--- a/litellm/proxy/management_endpoints/mcp_management_endpoints.py
+++ b/litellm/proxy/management_endpoints/mcp_management_endpoints.py
@@ -1451,8 +1451,13 @@ if MCP_AVAILABLE:
@router.post(
"/server/oauth/{server_id}/register",
include_in_schema=False,
+ dependencies=[Depends(user_api_key_auth)],
)
- async def mcp_register(request: Request, server_id: str):
+ async def mcp_register(
+ request: Request,
+ server_id: str,
+ user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
+ ):
mcp_server = _get_cached_temporary_mcp_server_or_404(server_id, request=request)
request_data = await _read_request_body(request=request)
data: dict = {**request_data}