Horseradish peroxidase (HRP) was used as a model glycoprotein, and a molecularly imprinted ratiometric fluorescence sensor based on a smartphone (NEB@MIP) was constructed using the sol–gel method for the fluorescence and visual detection of HRP. The sensor consisted of boronic acid-functionalized metal–organic frameworks (Eu-MOF-B(OH)2) and nitrogen-doped carbon dots (N-CDs). The Eu-MOF-B(OH)2 surface can not only load abundant N-CDs but also covalently bind with HRP through its boronic acid groups. The NEB@MIP exhibited two fluorescence emission peaks at 450 nm and 616 nm. When HRP was present, the fluorescence was quenched due to the internal filtering effect (IFE), but the quenching of N-CDs was more pronounced. Furthermore, the concentration of HRP in the range 0.05–10 µM showed a good linear relationship with the ratio of fluorescence intensity at 616 nm and 450 nm, with a detection limit (LOD) of 0.01 µM. Meanwhile, the sensor displayed a noticeable change in fluorescence color under different concentrations of HRP targets. Moreover, the sensor achieved satisfactory results in detecting simulated real samples, with recoveries ranging from 92.0% to 98.5% and RSDs between 1.5% and 3.3%. The detection platform based on the smartphone also performed well when detecting HRP in simulated real samples. Thus, this work provided a new approach for the portable detection of HRP. The method provides a new idea for the combination of ratiometric fluorescence molecular imprinting of glycoproteins and the portable detection platform of smart phones.