Macrocyclization is a critical strategy in rational drug design that can offer several advantages, such as enhancing binding affinity, increasing selectivity, and improving cellular permeability. Herein, we introduce MacGen, a web tool devised for structure-based macrocycle design. MacGen identifies exit vector pairs within a ligand that are suitable for cyclization and finds 3D linkers that can align with the geometric arrangement of these pairs to form macrocycles. To aid in the fast acquisition of appropriate linkers, we have built an indexed 3D linker database that includes linkers of various lengths and categories. MacGen provides comprehensive configurable parameters that enable users to obtain preferred linkers, meeting unique requirements in practical ligand design scenarios. We hope MacGen will serve as a handy tool that can rapidly explore potential macrocycle space. The MacGen server is freely accessible at https://macgen.xundrug.cn.