Melamine-derived mesoporous carbon, which was obtained from pyrolysis of modified melamine, was employed for the purpose of eliminating trace amounts of Hg(II) from honeysuckle decoction. The specific surface area of the mesoporous carbons with N-functional (MCN 1 ) was 648.372 m 2 •g −1 . The chemical composition and morphology of MCN 1 were thoroughly examined, and a comprehensive analysis led to the identification of its formation mechanism. A noteworthy association has been identified between the adsorption efficacy and the chemical composition of MCN 1 . In the elimination of trace mercury in aqueous solutions over a broad pH range (pH 2−9), MCN 1 demonstrates high effectiveness, approaching 100%. Adsorption kinetics and isotherm results indicate that a more accurate representation of Hg(II) adsorption on MCN 1 is provided by pseudo-second-order kinetics and Freundlich models, with chemical adsorption being the dominant mechanism. This study further examined the removal of chlorogenic acid, a bioactive component, by MCN 1 . The findings imply that MCN 1 has a noteworthy 80% efficacy in removing mercury from honeysuckle decoction while maintaining the purity of its medicinal ingredients, particularly chlorogenic acid. As a result, utilizing MCN 1 for the adsorption of Hg(II) in honeysuckle decoction appears to be a reasonable approach.