Histamine causes allergic reactions and can serve as an indicator for assessing food quality. This study designed and developed a dispersive micro solid-phase extraction (D-μSPE) method that combined the advantages of dispersive liquid-liquid extraction and solid-phase extraction (SPE). Molecularly imprinted polymers (MIPs) were employed as the solid phase in the D-μSPE method to extract histamine in wine samples. We used microwave energy to significantly reduce the synthesis time, achieving an 11.1-fold shorter synthesis time compared to the conventional MIP synthetic method. Under optimized D-μSPE conditions, our results showed that the dispersive solvent could effectively increase the adsorption performance of MIPs in wine samples by 97.7%. To improve the sensitivity of histamine detection in gas chromatography-mass spectrometry, we employed the microwave-assisted tandem derivatization method to reuse excess derivatization reagents and reduce energy consumption and reaction time. Calibration curves were constructed for wine samples spiked with 0-400 nmol histamine using the standard addition method, resulting in good linearity with a coefficient of determination of 0.999. The intra- and inter-batch relative standard deviations of the slope and intercept were < 0.7% and < 5.3%, respectively. The limits of quantitation and detection were 0.4 nmol and 0.1 nmol, respectively. The developed method was successfully applied to analyze the histamine concentration in 10 commercial wine samples. In addition, the AGREEprep tool was used to evaluate the greenness performance of the developed method, which obtained a higher score than the other reported methods.