A new BIM/MCNF/Nafion-modified glassy carbon electrode, combining the specific Hg2+-complexing ability of bis(indolyl)methane (BIM) with the unique properties of mesoporous carbon nanofiber (MCNF), was fabricated for anodic stripping analysis of Hg2+. BIM was synthesized and served as an ionophore for highly selective adsorption heavy metal Hg2+ from the sample solution. MCNF displayed extraordinary electrical conductivity and great adsorption ability to enhance the sensitivity of the modified electrode. Nafion, a sulfonated cation-exchange polymer, supplied the good stability of the modifying layer. The as-prepared electrochemical sensor significantly improved selectivity and sensitivity towards Hg2+ determination. The stripping current increased linearly with Hg2+ concentration at the range of 5–500nM under 15min accumulation at open-circuit potential, with a detection limit of 0.3nM. Meanwhile, the proposed electrode could avoid some interference of other heavy metal ions coexisting with Hg2+, such as Cd2+, Pb2+ and Cu2+. This new method has been successfully applied for the detection of Hg2+ in Yellow River with satisfactory results.