Let's start with the adiabatic energy equation,
$$\frac{\text{D}}{\text{D}t}\left(\frac{p}{\rho^\gamma}\right) = 0,$$
where $\text{D}/\text{D}t$ is the material derivative. The eulerian form of the previous equation is
$$\frac{\partial}{\partial t}\left(\frac{p}{\rho^\gamma}\right) + \mathbf{v}\cdot\nabla\left(\frac{p}{\rho^\gamma}\right) = 0.$$
The change rule provides
$$\frac{1}{\rho^\gamma}\left(\frac{\partial p}{\partial t} + \mathbf{v}\cdot\nabla p\right) + p\left(\frac{\partial}{\partial t}\left(\frac{1}{\rho^\gamma}\right) + \mathbf{v}\cdot\nabla\left(\frac{1}{\rho^\gamma}\right)\right) = 0,$$
and multiplying by $\rho^\gamma$,
$$\frac{\partial p}{\partial t} + \mathbf{v}\cdot\nabla p + p\left(\rho^\gamma\frac{\partial}{\partial t}\left(\frac{1}{\rho^\gamma}\right) + \mathbf{v}\cdot\rho^\gamma\nabla\left(\frac{1}{\rho^\gamma}\right)\right) = 0.$$
Both time derivative and gradient can be written as
$$\rho^\gamma\frac{\partial}{\partial t}\left(\frac{1}{\rho^\gamma}\right) = -\frac{\gamma}{\rho}\frac{\partial\rho}{\partial t},$$
$$\rho^\gamma\nabla\left(\frac{1}{\rho^\gamma}\right) = -\frac{\gamma}{\rho}\nabla\rho.$$
Finally, plugging them into the last equation,
$$\frac{\partial p}{\partial t} + \mathbf{v}\cdot\nabla p - c_s^2\left(\frac{\partial\rho}{\partial t} + \mathbf{v}\cdot\nabla\rho\right) = 0.$$
where $c_s^2 = \gamma p/\rho$. In addition, taking the continuity equation, i.e.
$$\frac{\partial\rho}{\partial t} + \nabla\cdot\left(\rho\mathbf{v}\right) = 0,$$
or
$$\frac{\partial\rho}{\partial t} + \mathbf{v}\cdot\nabla\rho = - \rho\nabla\cdot\mathbf{v},$$
the MHD energy equation is given by
$$\frac{\partial p}{\partial t} + \mathbf{v}\cdot\nabla p + \rho c_s^2\nabla\cdot\mathbf{v} = 0,$$
or in conservative form,
$$\frac{\partial \rho p}{\partial t} + \nabla\cdot (\rho\mathbf{v}p) = -(\rho c_s)^2\nabla\cdot\mathbf{v}.$$