{"record":{"id":"7b6da7be0f3188d4","repo":"BerriAI/litellm","slug":"only-proxy-admins-can-update-mcp-semantic-filter-s","errorCode":null,"errorMessage":"Only proxy admins can update MCP semantic filter settings.","messagePattern":"Only proxy admins can update MCP semantic filter settings\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py","lineNumber":1292,"sourceCode":"        config=config,\n    )\n\n\n@router.patch(\n    \"/update/mcp_semantic_filter_settings\",\n    tags=[\"Settings\"],\n    dependencies=[Depends(user_api_key_auth)],\n)\nasync def update_mcp_semantic_filter_settings(\n    settings: MCPSemanticFilterSettings,\n    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n):\n    \"\"\"\n    Update MCP semantic filter settings in database.\n    Settings will be picked up by all pods within approximately 10 seconds via background polling.\n    \"\"\"\n    if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:\n        raise HTTPException(\n            status_code=403,\n            detail=\"Only proxy admins can update MCP semantic filter settings.\",\n        )\n\n    result: Final = await _update_litellm_setting(\n        settings=settings,\n        settings_key=\"mcp_semantic_tool_filter\",\n        success_message=\"MCP Semantic Filter settings updated successfully. Changes will be applied across all pods within 10 seconds.\",\n        user_api_key_dict=user_api_key_dict,\n    )\n    try:\n        from litellm.proxy.proxy_server import prisma_client, proxy_config\n\n        if prisma_client is not None:\n            await proxy_config._init_semantic_filter_settings_in_db(prisma_client=prisma_client)\n    except Exception as e:\n        verbose_proxy_logger.warning(\"Failed to reinitialize MCP semantic filter settings immediately: %s\", e)\n","sourceCodeStart":1274,"sourceCodeEnd":1310,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py#L1274-L1310","documentation":"Role gate on PATCH /update/mcp_semantic_filter_settings: the authenticated caller's user_role is not PROXY_ADMIN. MCP semantic filter settings are cluster-wide, so only proxy admins may write them; any internal user or team key gets 403.","triggerScenarios":"Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:1292 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a proxy admin key to update MCP semantic filter settings."],"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"}