In the current study, a fiber coating based on copper 1,4-benzenedicarboxylate metal–organic framework (Cu-BDC MOF) was fabricated on the surface of a pencil graphite (PG) substrate by an in-situ electrodeposition approach. The fiber was used as the sorbent in fiber solid-phase microextraction (SPME) of two chosen pesticides including abamectin and amitraz [1,2]. The extracted pesticides were quantified by high-performance liquid chromatography-ultraviolet detection (HPLC-UV). The electrosynthesis of the fiber coating was performed under a constant potential in a solution containing sodium nitrate as the probase, 1,4-Benzenedicarboxylic acid as the ligand and copper nitrate as the cation source. The coating was characterized using field emission scanning electron microscopy (FESEM), energy-dispersive X-ray spectroscopy (EDX), Fourier transform infrared spectroscopy (FT-IR), and X-ray Diffraction (XRD) analysis. The effective parameters on the electrosynthesis and extraction processes were optimized by experimental design. Under the optimized conditions, the extracted amitraz and abamectin were quantified over an appropriate linear range. Suitable limits of determination, appropriate limits of quantifications, satisfactory enrichment factors, acceptable absolute recoveries and acceptable spiking recoveries were achieved for amitraz and abamectin.