We focus on the magnetohydrodynamics (MHD) equations in hetereogeneous media, i.e. media with (possibly brutal) variations on the physical properties. In particular, we are interested in solving the Maxwell equations with discontinuous magnetic properties. We introduce a method that is, to the best of our knowledge, new to solve this problem using only Lagrange Finite Elements. We then discuss its implementation in SFEMaNS, a numerical code developped since 2002 by J.-L. Guermond, C. Nore, J. Léorat, R. Laguerre and A. Ribeiro. We show the results of the first dynamo simulations we have been able to make with this solver. For instance, we present a kinematic dynamo in a VKS setup, as well as some results about dynamo action induced either by a Taylor-Couette flow, or by a precessionnally driven flow.