BerriAI/litellm · error · HTTPException
Only proxy admins can access MCP discovery. Your role={user_
Error message
Only proxy admins can access MCP discovery. Your role={user_api_key_dict.user_role} What it means
Admin gate on the MCP discovery listing endpoint: only PROXY_ADMIN may browse the curated MCP server catalog; other roles get HTTP 403 with their role embedded.
Source
Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2730
@router.get(
"/discover",
description="Returns a curated list of well-known MCP servers for discovery UI",
dependencies=[Depends(user_api_key_auth)],
)
async def discover_mcp_servers(
query: str | None = Query(None, description="Search filter for server names and descriptions"),
category: str | None = Query(None, description="Filter by category"),
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
"""
Returns a curated list of well-known MCP servers that can be added to the proxy.
Used by the UI to show a discovery grid when adding new MCP servers.
"""
# Admin Viewer follows the read-parity rule.
if not _user_has_admin_view(user_api_key_dict):
raise HTTPException(
status_code=403,
detail={
"error": f"Only proxy admins can access MCP discovery. Your role={user_api_key_dict.user_role}"
},
)
registry: Final = _load_mcp_registry()
servers = registry.get("servers", [])
# Apply query filter
if query:
query_lower: Final = query.lower()
servers = [
s
for s in servers
if query_lower in s.get("name", "").lower()
or query_lower in s.get("title", "").lower()
or query_lower in s.get("description", "").lower()View on GitHub (pinned to 77b7c6c40c)
Solutions
- Use a PROXY_ADMIN API key to access MCP discovery.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2730 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/997ff51d2c377055.
Report an issue: GitHub.