The interaction dynamics between drug-monomer-solvent is the backbone of the thermodynamic calculation in molecular imprinting process and the controlled drug release components. In this regards, thermodynamic computational calculation was used for preparation of magnetic molecular imprinted polymers (MMIPs) and their subsequent application in the controlled release of 5-fluorouracil in the cancer therapy. Cohesive energy density of components (CED)/resolution parameters (delta(d), delta(p), delta(H)) are the important characteristic of desired profile and design. Accordingly, the calculations for choosing the best reactants were performed based on the utilization of chemical affinity profiles of Hansen method. Based on the thermodynamic computational calculations, 4-vinylpyridine (4-VP) and acrylic acid (AA) were chosen as optimal monomers to synthesize MMIPs. MMIPs were utilized as the pH responsive nanocarrier systems in the controlled release of 5-fluorouracil (5-FU) as an anti-cancer drug. At first, the Fe3O4 nanoparticles were functionalized by vinyl triethoxysilane moieties and finally, a MIP layer was synthesized on the surface of modified magnetic nanoparticles via precipitation polymerization process. The prepared polymer was characterized by FT-IR spectroscopy, scanning electron microscopy, thermogravimetric analysis (TGA), differential scanning calorimetric analysis (DSC), elemental analysis, and X-ray diffraction analysis. The results of high performance liquid chromatography analysis illustrated the controllable release of 5-FUin simulated body fluid at pH = 5.8 and pH = 7.4. At the end of 30 day, 90% and 80% of 5-FU released at pH 5.8 from 5-FU/4-VP and 5-FU/AA MMIPs, respectively, while these values at pH 7.4 were 70% and 65%, for 5-FU/4-VP and 5-FU/AA MMIPs, respectively. The preparation of these MMIPs was facile and fast and they are biocompatible.