A magnetic adsorbent was synthesized by coupling magnetic nanoparticles, UiO-66-NH2 and 1-butyl-trimethylimidazole bromide ([BMIM][Br]) to chitosan (CS)-based composite conveniently. A series of modern characterizations were employed to assess its properties. The results showed that UiO-66-NH2 was uniformly distributed within the composite via in-situ growth, which can enhance the porosity obviously. The introduction of various ligands enables the composite to exhibit excellent extraction performance for four aflatoxins (AFs) through multiple interactions. The adsorption mechanism was elucidated and the main factors affecting extraction efficiency were evaluated. Under optimal conditions, the limits of detection (LODs) ranged from 0.08 to 0.56 μg/kg. The established method was successfully utilized to determine AFs from cereal samples (rice, glutinous rice, wheat, soybean, paddy, and corn) with satisfactory recovery of 77% ~ 119% with relative standard deviations (RSDs) of 1.0% ~ 11.7% (n = 5). The adsorbent demonstrated sufficient robustness for repeated use at least six times without obvious damage of extraction property.