Context. Magnetic fields have only recently been included in theoretical simulations of high-mass star formation. The simulations show that magnetic fields play an important role in the formation and dynamics of molecular outflows. Masers, in particular 6.7-GHz CH3OH masers, are the best probes of the magnetic field morphologies around massive young stellar objects on the smallest scales of 10–100 AU.