A highly sensitive electrochemical sensor was developed through a one-pot green synthesis method for nitrite detection based on the electrochemical technique. Xylan-based carbon quantum dots (CQDs) were used as green in situ reducing agent to prepare CQDs capped gold nanoparticles (Au@CQDs). MXene of good electrical conductivity was used as the immobilized matrix to fabricate Au@CQDs-MXene nanocomposites with the advantages of good electrical conductivity and electrocatalysis. An electrochemical sensor for nitrite monitor was obtained by loading the Au@CQDs-MXene on a glassy carbon electrode. The sensor presents high sensitivity, good stability, wide linear range, and excellent selectivity due to the high catalytic activity of AuNPs and CQDs, the large specific surface area of MXene, and exceptional electrical conductivity of AuNPs and MXene. Under the optimal condition, the linear detection range of the sensor was from 1 μM to 3200 μM with a detection limit of 0.078 μM (S/N = 3), which was superior to most reported sensors using differential pulse voltammetry (DPV) method. Furthermore, this sensor was successfully applied to detect nitrite in tap water and salted vegetables with satisfactory recoveries. This modified electrocatalytic sensor shows a new pathway to fabricate nitrite detection sensor with feasibility for practical application.