As global demand for renewable energy and electric vehicles increases, the need for lithium has surged significantly. Extracting lithium from salt lake brine has become a cutting-edge technology in lithium resource production. In this study, two-dimensional (2D) GO/MXene composite membranes were fabricated using pressure-assisted filtration with a polyethyleneimine (PEI) coating, resulting in positively charged PEI-GO/MXene membranes. These innovative membranes, taking advantage of the synergistic effects of interlayer channel sieving and the Donnan effect, demonstrated excellent performance in Mg2+/Li+ separation with a mass ratio of 20 (Mg2+ rejection = 85.3%, Li+ rejection = 16.7%, SLi,Mg = 5.7) in simulated saline lake brine. Testing on actual salt lake brine in Tibet, China, confirmed the composite membrane's potential for effective Mg2+/Li+ separation. In the actual brine test with high concentration, Mg2+/Li+ after membrane separation is 2.2, which indicates that the membrane can significantly reduce the concentration of Mg2+ in the brine. Additionally, the PEI-GO/MXene composite membrane demonstrated strong anti-swelling properties and effective divalent ion rejection. This research presents an innovative approach to advance the development of 2D membranes for the selective removal of Mg2+ and Li+ from salt lake brine.