The aim of the present work was to develop a novel in-house mixed-mode SPE sorbent to be used for the HPLC-Ion TrapMS determination of 16 basic drugs in urine.By using a computational modelling, a virtual monomer library was screened identifying three suitable functional monomers, methacrylic acid (MAA), itaconic acid (IA) and 2-acrylamide-2-methylpropane sulfonic acid (AMPSA), respectively. Three different sorbents were then synthetized based on these monomers, and using as cross-linker trimethylolpropane trimethacrylate (TMPTMA).The sorbent characterization analyses brought to the selection of the AMPSA based phase.Using this novel in-house sorbent, a SPE-HPLC-Ion TrapMS method for drug analysis in urine was validated proving to be selective and accurate and showing a sensitivity adequate for toxicological urine analysis. The comparison of the in-house mixed-mode SPE sorbent with two analogous commercial mixed-mode SPE phases showed that the first one was better not only in terms of process efficiency, but also in terms of quality-price rate.To the best of our knowledge, this is the first time in which an in-house SPE procedure has been applied to the toxicological analysis of a complex matrix, such as urine.