CouchbaseServerVersion() naively picks the first server version it encounters, however in a mid-upgrade scenario, nodes in the cluster have different versions, and the cluster as a whole is only upgraded when all nodes are running on the same later version.
cluster_compat_version is a encoded cluster-wide version number which reflects the Couchbase version of the entire cluster. This version is already used by other services determine feature compatibility, and seems cheaper to decode the major/minor versions from it than parsing the string formatted version.
We can get this out of the REST API at /pools/default or at /pools/default/buckets/:bucketName: (see attachment)
Prior art: goxdcr uses it for feature detection seen here: