Xiao-Ke-An, a traditional Chinese medicine formula against diabetes in China, is reported inhibitory activity on Dipeptidyl peptidase-4 (DPP-4). However, its molecular mechanism is still unclear due to the complexity of its components. In this study, a combination of molecular docking, molecular dynamics (MD) and molecular mechanics/Poisson Boltzmann surface area (MM-PBSA) method was conducted. The results show that multiple components of Xiao-Ke-An can take effect on DPP-4 together, which could be the part of the hypoglycemic mechanism of Xiao-Ke-An. Of the eight selected compounds, MOL003714 shows the highest activity for inhibiting DPP-4 with the binding free energy of -44.14 kcal·mol− 1 via binding to the S2 and S'1 subsites of DPP-4, which could be a potent inhibitor for DPP-4. This study provided theoretical basis for the discovery and modification of natural DPP-4 inhibitors and the deeply insight into Xiao-Ke-An.