Modulating metal-organic framework’s (MOF) crystallinity and size using a polymer, in conjunction with a high surface area of layered double hydroxide, yields an effective strategy for concurrently enhancing the electrochemical and photocatalytic performance. In this study, we present the development of an optimized nanocomposite, denoted as 0.5PVP/ZIF-67, developed on AZ31 magnesium alloy, serving as an efficient and durable multifunctional coating