We present constraints on the 𝑓(𝑅) gravity model using a sample of 1005 galaxy clusters in the redshift range 0.25–1.78 that have been selected through the thermal Sunyaev-Zel’dovich effect from South Pole Telescope data and subjected to optical and near-infrared confirmation with the multicomponent matched filter algorithm. We employ weak gravitational lensing mass calibration from the Dark Energy Survey Year 3 data for 688 clusters at 𝑧 <0.95 and from the Hubble Space Telescope for 39 clusters with 0.6 <𝑧 <1.7. Our cluster sample is a powerful probe of 𝑓(𝑅) gravity, because this model predicts a scale-dependent enhancement in the growth of structure, which impacts the halo mass function (HMF) at cluster mass scales. To account for these modified gravity effects on the HMF, our analysis employs a semianalytical approach calibrated with numerical simulations. Combining calibrated cluster counts with primary cosmic microwave background temperature and polarization anisotropy measurements from the Planck 2018 release, we derive robust constraints on the 𝑓(𝑅) parameter 𝑓𝑅0. Our results, log10|𝑓𝑅0| <−5.32 at the 95% credible level, are the tightest current constraints on 𝑓(𝑅) gravity from cosmological scales. This upper limit rules out 𝑓(𝑅)-like deviations from general relativity that result in more than a ∼20% enhancement of the cluster population on mass scales 𝑀200c>3×1014𝑀⊙.