We address the question whether the magnetorotational instability (MRI) can operate in the near-surface shear layer (NSSL) of the Sun and how it affects the interaction with the dynamo process. Using hydromagnetic mean-field simulations of αΩ-type dynamos in rotating shearing-periodic boxes, we show that for negative shear the MRI can operate above a certain critical shear parameter. This parameter scales inversely with the equipartition magnetic field strength above which α quenching set in. Like the usual Ω effect, the MRI produces toroidal magnetic field when the field is sufficiently strong. The work done by the Lorentz force is positive, so the magnetic field drives kinetic energy and not the other way around, as in a turbulent dynamo. This results in strong kinetic energy production and dissipation, which occurs at the expense of the magnetic energy. In view of the application to the solar NSSL, we conclude that the turbulent magnetic diffusivity may be too large for the MRI to be excited and that therefore only the standard Ω effect is expected to operate.