Aims. In this work we develop a technique to obtain high precision determinations of both metallicity and effective temperature of M dwarfs in the optical. Methods. A new method is presented that makes use of the information of 4104 lines in the 530-690 nm spectral region. It consists in the measurement of pseudo equivalent widths and their correlation with established scales of [Fe/H] and $T_{eff}$. Results. Our technique achieves a $rms$ of 0.08$pm$0.01 for [Fe/H], 91$pm$13 K for $T_{eff}$, and is valid in the (-0.85, 0.26 dex), (2800, 4100 K), and (M0.0, M5.0) intervals for [Fe/H], $T_{eff}$ and spectral type respectively. We also calculated the RMSE$_{V}$ which estimates uncertainties of the order of 0.12 dex for the metallicity and of 293 K for the effective temperature. The technique has an activity limit and should only be used for stars with $log{L_{H_{alpha}}/L_{bol}} < -4.0$. Our method is available online at url{http://www.astro.up.pt/resources/mcal}.