Trimethylamine N-oxide (TMAO), a molecule produced by the microbiota, has been associated with human health and illness. Its early discovery in body fluids may affect our understanding of the pathophysiology and treatment of many illnesses. Therefore, our knowledge of the pathophysiology and diagnostics of disorders associated with TMAO might be enhanced by the creation of dependable and fast methods for TMAO detection. Therefore, we developed a fluorescent probe for detecting TMAO utilizing an on−off−on strategy. Bovine serum albumin (BSA)@AuNCs luminescence is effectively quenched by Mo 4+ because BSA@AuNCs and Mo 4+ have a strong binding relationship. Mo 4+ ions can substantially decrease the emission intensity of gold nanoclusters by establishing a BSA@AuNCs-Mo system. Then, the luminescence of BSA@AuNCs was restored due to the interaction between Mo 4+ and TMAO. A significant linear relationship was seen between the emission intensity and TMAO concentration within the 0−201 μM range, with a detection limit of 1.532 μM. Additionally, the method can measure TMAO in blood and urine samples.