{"record":{"id":"7bc512ec67755811","repo":"BerriAI/litellm","slug":"only-proxy-admins-can-update-public-mcp-servers-y","errorCode":null,"errorMessage":"Only proxy admins can update public mcp servers. Your role={user_api_key_dict.user_role}","messagePattern":"Only proxy admins can update public mcp servers\\. Your role=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":2646,"sourceCode":"        request: MakeMCPServersPublicRequest,\n        user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n    ):\n        \"\"\"\n        Make MCP servers public for AI Hub\n        \"\"\"\n        try:\n            # Update the public model groups\n            import litellm\n            from litellm.proxy._experimental.mcp_server.mcp_server_manager import (\n                global_mcp_server_manager,\n            )\n            from litellm.proxy.proxy_server import proxy_config\n\n            # Load existing config\n            config: Final = await proxy_config.get_config()\n            # Check if user has admin permissions\n            if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:\n                raise HTTPException(\n                    status_code=403,\n                    detail={\n                        \"error\": f\"Only proxy admins can update public mcp servers. Your role={user_api_key_dict.user_role}\"\n                    },\n                )\n\n            if litellm.public_mcp_servers is None:\n                litellm.public_mcp_servers = []\n\n            for server_id in request.mcp_server_ids:\n                server = global_mcp_server_manager.get_mcp_server_by_id(server_id=server_id)\n                if server is None:\n                    raise HTTPException(\n                        status_code=404,\n                        detail=f\"MCP Server with ID {server_id} not found\",\n                    )\n\n            litellm.public_mcp_servers = request.mcp_server_ids","sourceCodeStart":2628,"sourceCodeEnd":2664,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L2628-L2664","documentation":"Role guard on the make-servers-public endpoint (AI Hub): flipping servers to public rewrites proxy config (litellm.public_mcp_servers / proxy_config), a privileged operation. The caller's role is not PROXY_ADMIN and the role is echoed in the message.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2646 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a PROXY_ADMIN key to update public MCP servers, or make the server non-public."],"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"}