In recent years, magnesium alloys (MgA) have been reckoned as the most promising material of biomedical importance on account of its excellent degradable properties and mechanical properties mimicking natural bone tissues. However, MgA are prone to rapid corrosion under physiological conditions, causing toxicity around the neighboring tissues. In addition, they are susceptible to bacterial colonization, a detrimental factor for medical causes. In this study, antibacterial material coated hydrogel-based micro-patterns were developed on MgA to achieve long-term antibacterial, antifouling, osteogenic, and cell-compatible properties. First, the Mg(OH)2 nanosheet coating was prepared on the surface of MgA as a physical barrier to prevent the corrosion of MgA. Then the hydrogel micropatterns of poly(alendronate sodium methacrylate)/poly(dimethyldiallylammonium chloride)/poly(ethylene glycol) diacrylate (PALNMA/PDADMAC/PEGDA) of different sizes were constructed on the surface of the Mg(OH)2 coating using the photomask method. Finally, an intelligently responsive antibacterial material hyaluronic acid/berberine (HA/BBR) was coated on MgA-Mg(OH)2-PALNMA/PDADMAC/PEGDA patterns via layer-by-layer self-assembly. The excellent antifouling performance of the samples is attributed to the topological structure of the pattern. Interestingly, as the pattern size of PALNMA/PDADMAC/PEGDA decreases, the antibacterial, antifouling, and cell compatibility properties of the samples gradually improve. UV–Vis spectra and bacterial plate count indicate that HA/BBR coating provide a pH and hyaluronidase (HAase) dual-responsive surface to kill the attached bacteria quickly. Finally, the in vitro experiments demonstrate excellent blood compatibility, cell compatibility and osteogenic properties of the modified MgA samples. Therefore, the intelligent multifunctional assembly of MgA presented here has a promising future in the field of metal implant materials.