{"record":{"id":"aa8ec2b5e8692cda","repo":"BerriAI/litellm","slug":"mcp-server-with-id-server-id-not-found-aa8ec2","errorCode":null,"errorMessage":"MCP Server with ID {server_id} not found","messagePattern":"MCP Server with ID (.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":2659,"sourceCode":"\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\n\n            # Update config with new settings\n            if \"litellm_settings\" not in config or config[\"litellm_settings\"] is None:\n                config[\"litellm_settings\"] = {}\n\n            config[\"litellm_settings\"][\"public_mcp_servers\"] = litellm.public_mcp_servers\n\n            # Save the updated config\n            await proxy_config.save_config(new_config=config)\n\n            verbose_proxy_logger.debug(\n                \"Updated public mcp servers to: %s by user: %s\", litellm.public_mcp_servers, user_api_key_dict.user_id\n            )","sourceCodeStart":2641,"sourceCodeEnd":2677,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L2641-L2677","documentation":"Lookup failure while updating public MCP servers: no server with the given server_id exists in config or the registry, so the public-list update has no target.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:2659 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the server_id exists via GET /mcp/servers before updating."],"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"}