{"record":{"id":"23bcf40e58cd10e4","repo":"BerriAI/litellm","slug":"proxy-admin-users-should-use-post-v1-mcp-server-t","errorCode":null,"errorMessage":"PROXY_ADMIN users should use POST /v1/mcp/server to create servers directly instead of the submission workflow.","messagePattern":"PROXY_ADMIN users should use POST /v1/mcp/server to create servers directly instead of the submission workflow\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":1239,"sourceCode":"    @router.post(\n        \"/server/register\",\n        description=\"Submit a new MCP server for admin review (non-admin users). Mirrors POST /guardrails/register.\",\n        dependencies=[Depends(user_api_key_auth)],\n        response_model=LiteLLM_MCPServerTable,\n        status_code=status.HTTP_201_CREATED,\n    )\n    @management_endpoint_wrapper\n    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:","sourceCodeStart":1221,"sourceCodeEnd":1257,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L1221-L1257","documentation":"Workflow-direction guard on POST /v1/mcp/server/register: the submission workflow exists for non-admin users to propose servers for review. A PROXY_ADMIN called it; admins create servers directly via POST /v1/mcp/server, so routing them into the pending-review queue is rejected with 403.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:1239 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use POST /v1/mcp/server directly to create the server as a proxy admin.","Reserve the submission workflow for non-admin users."],"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-14T05:17:10.506Z"}