In this study, a highly sensitive optical probe is designed, fabricated, and evaluated that is composed of a microfluidic device integrated with a fiber optic sensor for environmental monitoring. The resonant cavity is coated with a metal ion‐responsive molecularly imprinted nanocomposite film and monitored by a single‐mode fiber (SMF) optic sensor. The resulting Fabry–Pérot cavity‐based optical probe can accurately measure Hg levels in water with high sensitivity and stability. The nanocomposite film is synthesized using a one‐pot reaction process involving sodium alginate (SA)‐reduced nanosilver particles (nanoAg) dispersed in polyvinyl alcohol (VA). When an aqueous solution containing mercury is injected into the microfluidic device, interactions between Ag and Hg at the nanoscale form a solid Ag‐Hg solid amalgam in the resonant cavity, and surface plasmon resonance (SPR) and the Fabry–Pérot effect can be exploited to detect the presence of Hg. The synthesis, fabrication, and measurement system of this integrated device is simple and cost effective. The developed sensing heavy metals in wastewater treatment, catalysis enhancement, and nanoscale toxicity assessment, and contributes practically to achieving the sustainable development goal (SDG) of access to safe drinking water.