Abstract Endowing functional crystals with flexibility significantly broadens their potential applications in the field of flexible smart devices. Despite tremendous efforts to understand the foundational structural principles of flexibility, most discoveries of crystals with mechanical flexibility remain accidental. Currently, machine learning has become a transformative research paradigm in materials science. Here, we propose an innovative approach and develop a platform for predicting the mechanical properties of molecular crystals named CrystalGAT. CrystalGAT is a graph neural network model based on attention mechanisms, which constructs a robust optimal model through data augmentation strategies and achieves markedly superior prediction performance compared to established models. A high prediction accuracy of 90% is demonstrated on the validation set, alongside a promising generalization capability that extends to multicomponent systems. Most importantly, we have identified key segments influencing the mechanical properties of molecular crystals using CrystalGAT, successfully achieving a breakthrough in transforming brittle crystals into flexible photoresponsive crystals. Furthermore, it is possible to quickly screen for plastic multicomponent drug crystals, enhancing tableting performance. CrystalGAT provides an efficient method for flexible molecular crystal design, demonstrating its potential applications in material discovery and drug molecular modification. For user convenience, a dedicated website has been established: https://huggingface.co/spaces/ZZZCCCYYY/CrystalGAT .