Metal–organic frameworks (MOFs) are compounds that feature metal clusters coordinated with organic ligands, forming impressive structures and properties. In this study, two MOFs of Zn(II) and Cd(II) were synthesized using the organic compound 5‑hydroxy-2-pyrazinecarboxylic acid, forming Zn-MOF and Cd-MOF. To better understand the intricate structures of these MOFs, single-crystal X-ray crystallography was used to characterize their respective structures. The results showed that both MOFs have complex three-dimensional supramolecular structures that are highly symmetric and contain water molecules. Additionally, topological analysis of the MOFs indicated that they have a zeolite-like structure. The Hirshfeld surfaces analysis revealed that both crystal structures could preferentially interact with other molecules through hydrogen bonds. The MOFs were found to have a direct band gap, with the energy observed to be 2.44 and 2.71 eV for the Zn-MOF and Cd-MOF systems, respectively. The hydrogen bond formation ability of the MOFs, in combination with their low band gap energy, make them highly suitable for use in the Knoevenagel condensation reaction in water. Overall, the results of this study provide important insights into the unique properties and potential applications of MOFs in diverse fields.