{"record":{"id":"055487128ab97551","repo":"BerriAI/litellm","slug":"mcp-server-server-id-not-found","errorCode":null,"errorMessage":"MCP server '{server_id}' not found.","messagePattern":"MCP server '(.+?)' not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":1349,"sourceCode":"    @management_endpoint_wrapper\n    async def approve_mcp_server_submission(\n        server_id: str,\n        user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n    ):\n        \"\"\"\n        Admin approves a pending or previously-rejected MCP server — sets approval_status=active and loads it into the runtime registry.\n        \"\"\"\n        if LitellmUserRoles.PROXY_ADMIN != user_api_key_dict.user_role:\n            raise HTTPException(\n                status_code=status.HTTP_403_FORBIDDEN,\n                detail={\"error\": \"Admin access required to approve MCP server submissions.\"},\n            )\n\n        prisma_client: Final = get_prisma_client_or_throw(\"Database not connected. Connect a database to your proxy\")\n\n        existing: Final = await get_mcp_server(prisma_client, server_id)\n        if existing is None:\n            raise HTTPException(\n                status_code=status.HTTP_404_NOT_FOUND,\n                detail={\"error\": f\"MCP server '{server_id}' not found.\"},\n            )\n        if existing.approval_status == MCPApprovalStatus.active:\n            raise HTTPException(\n                status_code=status.HTTP_400_BAD_REQUEST,\n                detail={\"error\": \"MCP server is already active.\"},\n            )\n\n        approved: Final = await approve_mcp_server(\n            prisma_client,\n            server_id,\n            touched_by=user_api_key_dict.user_id or LITELLM_PROXY_ADMIN_NAME,\n        )\n        await global_mcp_server_manager.invalidate_byom_submitted_servers_cache(approved.submitted_by)\n        await global_mcp_server_manager.reload_servers_from_database()\n\n        return _redact_mcp_credentials(approved)","sourceCodeStart":1331,"sourceCodeEnd":1367,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L1331-L1367","documentation":"Lookup guard in the approve flow: get_mcp_server returned no DB row for the given server_id, so there is nothing to approve. Usually means the id is wrong, the submission was deleted, or the caller is pointing at a config-defined server that never gets a DB row.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:1349 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the server_id exists by listing MCP server submissions first.","Check for typos in the server_id value."],"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-14T00:17:10.932Z"}