Hamiltonian reduction and Maurer-Cartan equations