The phosphorescence lifetime approach based on the room temperature phosphorescence (RTP) property has received considerable attention in recent years due to its excellent performance in the precise measurement of oxygen. Herein, a smart nanoprobe, Gd[PC]@ZIF-8, was designed and assembled by homogenously encapsulating a rare-earth complex phosphor Gd[(Pyr)4cyclen] (Pyr = pyrenol) into a zeolitic imidazolate framework (ZIF-8). Because of the restriction of the metal-organic framework (MOF) matrix and host-guest interactions, the nanoprobe Gd[PC]@ZIF-8 exhibited highly enhanced RTP properties, including intensity, quantum yield, and elongated decay lifetime. It displayed an outstanding linear relationship between the phosphorescence decay lifetime, intensity and oxygen concentration, which can be applied in the field of oxygen sensing. Moreover, the complex Gd[(Pyr)4cyclen] in the nanoprobe Gd[PC]@ZIF-8 served as a favorable photosensitizer that resulted in the simultaneous conversion of sufficient oxygen molecules into single state oxygen (1O2) under irradiation during the phosphorescence quenching process, which is conducive to photodynamic therapy (PDT). Thus, the design of the smart nanoprobe Gd[PC]@ZIF-8 in this study provides an ingenious strategy of utilizing a MOF as a matrix to enhance the RTP properties of phosphors for synchronous oxygen sensing and PDT.