BerriAI/litellm · error · HTTPException
Registration requires an API key associated with a team. Use
Error message
Registration requires an API key associated with a team. Use a team-scoped key.
What it means
Prerequisite guard on POST /v1/mcp/server/register: the API key used has no team_id. Submissions are filed on behalf of a team (the server is later attributed/approved in a team context), so a personal or unscoped key cannot use this endpoint.
Source
Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:1247
async def register_mcp_server(
payload: NewMCPServerRequest,
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
"""
Allow team members to submit an MCP server for admin review.
Creates the server with approval_status=pending_review.
Requires a team-scoped API key.
"""
if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN:
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail={
"error": "PROXY_ADMIN users should use POST /v1/mcp/server to create servers directly instead of the submission workflow."
},
)
if not user_api_key_dict.team_id:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail={"error": "Registration requires an API key associated with a team. Use a team-scoped key."},
)
# stdio servers spawn a local subprocess on the proxy host with the
# configured command + args, so accepting them from non-admin callers
# would let a team member propose a server config that an admin could
# rubber-stamp into local code execution. Restrict stdio submission to
# the admin POST /v1/mcp/server path or to config.yaml.
if payload.transport == MCPTransport.stdio:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail={
"error": (
"stdio MCP servers cannot be submitted via the user "
"registration workflow. Ask a proxy admin to add this "
"server via POST /v1/mcp/server or to declare it in "
"config.yaml."View on GitHub (pinned to 77b7c6c40c)
Solutions
- Authenticate with a team-scoped virtual key for the registration request.
- Create a key bound to your team via /key/generate, then retry.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:1247 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/74cb63c169a984a2.
Report an issue: GitHub.