It is significant but challenging to develop polarity sensors that can measure multiscenario polarity in a modular, customized, sensitive, and accurate manner. In this work, we proposed a polarity sensor based on multivariate lanthanide metal-organic framework (Ln-MOF) nanoclusters through the modular programming design of ligands. This multivariate Ln-MOF combines the advantages of modularity, ease of design, high flexibility and low cost, and can be precisely customized for different polarity systems. The MOF Eu0.1Tb0.9-isophthalic acid (IPA) and Eu0.3Tb0.7-o-phthalic acid (OPA) are suitable for the detection of trace water in dimethylsulfoxide (DMSO) and hyaluronidase activity, respectively. Especially, Eu0.3Tb0.7-OPA can achieve high-sensitivity detection of hyaluronidase activity within 8 min, with the limit of detection as low as 0.016 U/L. The results enable us to break through our previous understanding of polarity parameter, allowing us to develop more polarity-related biosensing platforms. Ln-MOFs are believed to utilize their adjustable polar intermolecular interactions to achieve the optimal compatibility and high sensitivity in polarity sensing systems, which is supported by experiments and density functional theory calculations. These polarity sensors based on multivariate Ln-MOF nanoclusters offer significant potential in biosensing and medical diagnostics, overcoming traditional biosensor limitations in synthesis and customization.