This study was aimed to synthesize a new molecularly imprinted polymer using a functional monomer of styrene(STY) and allyl chloride(ALC) and N, N-methylene bis-acrylamide (MBAA) as a cross-linker for the selective extraction of cocaine from urine samples. Cocaine is used as a template to create a monolithic solid-phase micro extraction (SPME) fiber. All of these analytical procedures were utilized to extract, preconcentrate, and selectively determine Cocaine and its derivatives (SPME) with gas chromatography and mass spectrometry (GC/MS). Samples taken from a suspected cocaine addict who was given to the medico-legal directorate as a donation (Baghdad, Iraq). The analytes were monitored using UV-Vis , (GC MS), FTIR and Scanning electron microscopy (SEM). The RSD percent for two patients' repeated studies for three measurements range from (1.587-4.545) percent cocaine 20-100 ppm .