Electrocatalytic synthesis under mild conditions has become increasingly important as one of the practical alternatives for industrial applications, especially for the green ammonia (NH3) industry. A properly engineered electrocatalyst plays a vital role in the realization of superior catalytic performance. Among various types of promising nanomaterials, metal-organic frameworks (MOFs) are competitive candidates for developing efficient electrocatalytic NH3 synthesis from simple nitrogen-containing molecules or ions, such as N2 and NO3-. In this review, recent advances in the development of electrocatalysts derived from MOFs for the electrosynthesis of NH3 are collected, categorized, and discussed, including their application in the N2 reduction reaction (NRR) and the NO3- reduction reaction (NO3RR). Firstly, the fundamental principles are illustrated, such as plausible mechanisms of NH3 generation from N2 and NO3-, the apparatus of corresponding electrocatalysis, parameters for evaluation of reaction efficiency, and detection methods of yielding NH3. Then, the electrocatalysts for NRR processes are discussed in detail, including pristine MOFs, MOF-hybrids, MOF-derived N-doped porous carbons, single atomic catalysts from pyrolysis of MOFs, and other MOF-related materials. Subsequently, MOF-related NO3RR processes are also listed and discussed. Finally, the existing challenges and prospects for the rational design and fabrication of electrocatalysts from MOFs for electrochemical NH3 synthesis are presented, such as the evolution of investigation methods with artificial intelligence, innovation in synthetic methods of MOF-related catalysts, advancement of characterization techniques, and extended electrocatalytic reactions.