{"record":{"id":"74cb63c169a984a2","repo":"BerriAI/litellm","slug":"registration-requires-an-api-key-associated-with-a","errorCode":null,"errorMessage":"Registration requires an API key associated with a team. Use a team-scoped key.","messagePattern":"Registration requires an API key associated with a team\\. Use a team-scoped key\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":1247,"sourceCode":"    async def register_mcp_server(\n        payload: NewMCPServerRequest,\n        user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n    ):\n        \"\"\"\n        Allow team members to submit an MCP server for admin review.\n        Creates the server with approval_status=pending_review.\n        Requires a team-scoped API key.\n        \"\"\"\n        if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN:\n            raise HTTPException(\n                status_code=status.HTTP_403_FORBIDDEN,\n                detail={\n                    \"error\": \"PROXY_ADMIN users should use POST /v1/mcp/server to create servers directly instead of the submission workflow.\"\n                },\n            )\n\n        if not user_api_key_dict.team_id:\n            raise HTTPException(\n                status_code=status.HTTP_400_BAD_REQUEST,\n                detail={\"error\": \"Registration requires an API key associated with a team. Use a team-scoped key.\"},\n            )\n\n        # stdio servers spawn a local subprocess on the proxy host with the\n        # configured command + args, so accepting them from non-admin callers\n        # would let a team member propose a server config that an admin could\n        # rubber-stamp into local code execution. Restrict stdio submission to\n        # the admin POST /v1/mcp/server path or to config.yaml.\n        if payload.transport == MCPTransport.stdio:\n            raise HTTPException(\n                status_code=status.HTTP_400_BAD_REQUEST,\n                detail={\n                    \"error\": (\n                        \"stdio MCP servers cannot be submitted via the user \"\n                        \"registration workflow. Ask a proxy admin to add this \"\n                        \"server via POST /v1/mcp/server or to declare it in \"\n                        \"config.yaml.\"","sourceCodeStart":1229,"sourceCodeEnd":1265,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L1229-L1265","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:1247 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Authenticate with a team-scoped virtual key for the registration request.","Create a key bound to your team via /key/generate, then retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}