Total mechanical energy of the system remains same.
Total mechanical energy = potential energy + kinetic energy
At mean position, kinetic energy is maximum where as potential energy is minimum and at maximum amplitude, kinetic energy is minimum and potential energy is maximum.
Therefore energy changes form one form of energy to the another form of energy but net mechanical energy remains same.