Nitrogen electro-reduction under mild conditions is one promising alternative approach of the energy-consuming Haber-Bosch process for the artificial ammonia synthesis. One critical aspect to unlocking this technology is to discover the catalysts with high selectivity and efficiency. In this work, the N2-to-NH3 conversion on the functional MoS2 is fully investigated by density functional theory calculations since the layered MoS2 provides the ideal platform for the elaborating copies of the nitrogenase found in nature, wherein the functionalization is achieved via basal-adsorption, basal-substitution or edge-substitution of transition metal elements. Our results reveal that the edge-functionalization is a feasible strategy for the activity promotion; however, the basal-adsorption and basal-substitution separately suffer from the electrochemical instability and the NRR inefficiency. Specifically, MoS2 functionalized via edge W-substitution exhibits an exceptional activity. The energetically favored reaction pathway is through the distal pathway and a limiting potential is less than 0.20 V. Overall, this work escalates the rational design of the high-effective catalysts for nitrogen fixation and provides the explanation why the predicated catalyst have a good performance, paving the guidance for the experiments.