Self-consistent mean-field magnetohydrodynamics