The aim of this study is a present of a simple solvothermal synthesis approach to preparation of Cu-based magnetic metal organic framework (MMOF) and subsequently its application as sorbent for ultrasound assisted magnetic solid phase extraction (UAMSPE) of ampicillin (AMP) from cow milk samples prior to high performance liquid chromatography-Ultraviolet (HPLC-UV) determination. Characteristics of prepared MMOF were fully investigated by different techniques which showed the exclusive properties of proposed sorbent in terms of proper functionality, desirable magnetic property and also high specific surface area. Different influential factors on extraction recovery including sorbent dosage, ultrasonic time, washing solvent volume and eluent solvent volume were assessed using central composite design (CCD) based response surface methodology (RSM) as an operative and powerful optimization tool. This is the first report for determination of AMP using MMOF. The proposed method addressed some drawbacks of other methods and sorbents for determination of AMP. The presented method decreases the extraction time (4 min) and also enhances adsorption capacity (250 mg/g). Moreover, the magnetic property of presented sorbent (15 emu/g) accelerates the extraction process which does not need filtration, centrifuge and precipitation procedures. Under the optimized conditions, the proposed method is applicable for linear range of 1.0–5000.0 μg/L with detection limit of 0.29 μg/L, satisfactory recoveries (≥95.0%) and acceptable repeatability (RSD less than 4.0%). The present study indicates highly promising perspectives of MMOF for highly effective analysis of AMP in complicated matrices.