One-step solid-phase extraction (SPE) using a multiwalled carbon nanotube (MWCNT) for simultaneous analysis of 21 mycotoxins, including nine trichothecenes, zearalenone (ZEN) and its derivatives, four aflatoxins, and two ochratoxins, in corn and wheat was developed. Several key parameters affecting the performance of the one-step SPE procedure—types of MWCNT, combinations with five sorbents (octadecylsilyl (C18), hydrophilic–lipophilic balance (HLB), mixed-mode cationic exchange (MCX), silica gel, and amino-propyl (NH2)), and filling amounts of the MWCNTs—were thoroughly investigated. The combination of 20 mg carboxylic MWCNT and 200 mg C18 was proven to be the most effective, allowing the quantification of all analyzed mycotoxins in corn and wheat. Under the optimized cleanup procedure prior to ultraperformance liquid chromatography–tandem mass spectrometry (UPLC–MS/MS) analysis, the method was validated by analyzing samples spiked at the limit of quantification (LOQ), two-times LOQ, and 10-times LOQ. Satisfactory linearity (r2 ≥ 0.9910), high sensitivity (LOQ in different ranges of 0.5–25 μg L−1), good recovery (75.6–110.3%), and acceptable precision (relative standard deviation (RSD), 0.3–10.7%) were obtained. The applicability of the method was further confirmed using raw samples of corn and wheat. In conclusion, the established method was rapid, simple and reliable for simultaneous analysis of 21 mycotoxins in corn and wheat.