Cheap and abundant electrocatalysts for hydrogen evolution reactions (HER) have been widely pursued for their practical application in hydrogen-energy technologies. In this work, I present systematical study of the hydrogen evolution reactions on MXenes (Mo2X and W2X, X = C and N) based on density-functional-theory calculations. I find that their HER performances strongly depend on the composition, hydrogen adsorption configurations, and surface functionalization. I show that W2C monolayer has the best HER activity with near-zero overpotential at high hydrogen density among all of considered pure MXenes, and hydrogenation can efficiently enhance its catalytic performance in a wide range of hydrogen density further, while oxidization makes its activity reduced significantly. I further show that near-zero overpotential for HER on Mo2X monolayers can be achieved by oxygen functionalization. My calculations predict that surface treatment, such as hydrogenation and oxidization, is critical to enhance the catalytic performance of MXenes. I expect that MXenes with HER activity comparable to Pt in a wide range of hydrogen density can be realized by tuning composition and functionalizing, and promotes their applications into hydrogen-energy technologies.