BACKGROUND Thymol is a natural essential oil with strong volatility, low solubility, poor dispersion, strong irritation, and an unpleasant smell, which often requires appropriate porous materials to encapsulate thymol during the application process. However, the encapsulation efficiency of thymol in inclusion complexes is low, and new methods of encapsulation need to be developed. In the present study, the encapsulation capacity, storage stability, and antibacterial activity of thymol were investigated using gamma-cyclodextrin (gamma-CD) metal-organic frameworks (MOFs) by cocrystallization and high-temperature adsorption methods. The effect of different potassium salts (i.e. KOH, KCl, and KAc) on the structure and complexation of gamma-CD-MOFs was also analyzed. RESULTS Compared with gamma-CD, the thymol encapsulation capacity of gamma-CD-MOFs was increased by two- to three-fold, with the encapsulation content following the order: KAc-gamma-CD-MOF (293.8 mg g(-1)) > KOH-gamma-CD-MOF (287.7 mg g(-1)) > KCl-gamma-CD-MOF (249.3 mg g(-1)). The anions in the solution participate in the coordination and influence the symmetry relationship between atoms and ions. This explains the differences in both the three-dimensional gamma-CD-MOF structure and the thymol encapsulation amount, as well as the high storage stability of thymol. CONCLUSION The in vitro release kinetics and antibacterial experiments showed that the inclusion complexes prepared by gamma-CD-MOFs had higher stability, sustainability, and antibacterial activity, which suggests that it is an excellent complex material for industrial and agricultural applications. (c) 2022 Society of Chemical Industry.