The problem of magnetohydrodynamics boundary layer flow and heat transfer on a permeable stretching surface in a second grade nanofluid under the effect of heat generation and partial slip is studied theoretically. The Brownian motion and thermophoresis effects are also considered. The boundary layer equations governed by the PDE’s are transformed into a set of ODE’s with the help of local similarity transformations. The differential equations are solved by variational finite element method. The effects of different controlling parameters on the flow field and heat transfer characteristics are examined. The numerical results for the dimensionless velocity, temperature and nanoparticle volume fraction as well as the reduced Nusselt and Sherwood number have been presented graphically. The comparison confirmed excellent agreement. The present study is of great interest in coating and suspensions, cooling of metallic plate, oils and grease, paper production, coal water or coal-oil slurries, heat exchangers technology, materials processing exploiting.