Erythromycin (ERY) is a class of antibiotic that is suggested as one of the prior drinking water contaminants at latest European Union Water Framework Directive (EU-WFD). The main goal of this study was to develop molecularly imprinted polymer (MIP) based microcantilever sensor for the detection of ERY. ERY imprinted polymeric nanoparticles (MIP-NPs) were synthesized with miniemulsion polymerization and their size was measured to be 22 +/- 4 nm with high monodispersity. The immobilization of MIP-NPs on the microcantilevers was accomplished by EDC/NHS activation, which provided a monolayer covalent binding. The mass detection of the adsorption-desorption studies was performed in air for a concentration range of 0.68-67.94 mu M, employing the dynamic sensing mode. Experiments revealed that the frequency shifted to lower values as the MIP-NPs on the surface of the cantilever were exposed to the template molecule (ERY). Results showed high linearity of 96% in air. The sensitivity of the sensor was determined as 1.58 Hz/pg. Selectivity and sensitivity studies were performed with Spiramycin (SPI) and non-imprinted polymeric nanoparticles (NIP-NPs). Reusability studies showed that the system can be used up to 3 times. The adsorption isotherm analyses were carried out to investigate the interaction between ERY and the microcantilever sensor. From the calculation, the best isotherm to represent the adsorption model of the study was found as Freundlich. The developed sensor is low-cost and is easily applicable by the user. It has the potential to be a pioneer in the microcantilever mass sensing via molecularly imprinting technology. (C) 2017 Elsevier B.V. All rights reserved.