{"record":{"id":"d4ed08ce3584d5ad","repo":"BerriAI/litellm","slug":"you-do-not-have-permission-to-view-mcp-servers-for","errorCode":null,"errorMessage":"You do not have permission to view MCP servers for this team.","messagePattern":"You do not have permission to view MCP servers for this team\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":1119,"sourceCode":"            if not is_admin:\n                from litellm.proxy.auth.auth_checks import get_team_object\n                from litellm.proxy.proxy_server import (\n                    prisma_client,\n                    user_api_key_cache,\n                )\n\n                team_obj: Final = await get_team_object(\n                    team_id=sanitized_team_id,\n                    prisma_client=prisma_client,\n                    user_api_key_cache=user_api_key_cache,\n                    check_db_only=True,\n                )\n                user_in_team: Final = any(\n                    m.user_id is not None and m.user_id == user_api_key_dict.user_id\n                    for m in team_obj.members_with_roles\n                )\n                if not user_in_team:\n                    raise HTTPException(\n                        status_code=403,\n                        detail=\"You do not have permission to view MCP servers for this team.\",\n                    )\n\n            redacted_mcp_servers = await _get_team_scoped_mcp_server_list(sanitized_team_id)\n        else:\n            servers: Final = await _resolve_accessible_mcp_servers(user_api_key_dict)\n            redacted_mcp_servers = _redact_mcp_credentials_list(servers)\n\n        if connected_app_view is True and is_ui_session_credential(user_api_key_dict):\n            reachable_ids: Final = await _connected_app_reachable_server_ids(user_api_key_dict)\n            for server in redacted_mcp_servers:\n                server.connected_app_reachable = server.server_id in reachable_ids\n\n        # augment the mcp servers with public status\n        if litellm.public_mcp_servers is not None:\n            for server in redacted_mcp_servers:\n                if server.server_id in litellm.public_mcp_servers:","sourceCodeStart":1101,"sourceCodeEnd":1137,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L1101-L1137","documentation":"Authorization check for GET /v1/mcp/server?team_id=: the caller is not a proxy admin and the team object fetched from the DB (check_db_only) shows the caller's user_id is not a member of the requested team, so listing that team's MCP servers is denied.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:1119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a key associated with the team that owns the MCP servers.","Ask a team admin or proxy admin to grant you access."],"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"}