Moutan Cortex (MC) has been used in treating inflammation-associated diseases and conditions in China and other Southeast Asian countries. However, the active components of its anti-inflammatory effect are still unclear. The study aimed to screen and identify potential cyclooxygenase-2 (COX-2) inhibitors in MC extract. The effect of MC on COX-2 was determined in vitro by COX-2 inhibitory assays, followed by bio-affinity ultrafiltration in combination with ultra-performance liquid chromatography-mass spectrometry (BAUF-UPLC-MS). To verify the reliability of the constructed approach, celecoxib was applied as the positive control, in contrast to adenosine which served as the negative control in this study. The bioactivity of the MC components was validated in vitro by COX-2 inhibitor assay and RAW264.7 cells. Their in vivo anti-inflammatory activity was also evaluated using LPS-induced zebrafish inflammation models. Finally, molecular docking was hired to further explore the internal interactions between the components and COX-2 residues. The MC extract showed an evident COX-2-inhibitory effect in a concentration-dependent manner. A total of 11 potential COX-2 inhibitors were eventually identified in MC extract. The COX-2 inhibitory activity of five components, namely, gallic acid (GA), methyl gallate (MG), galloylpaeoniflorin (GP), 1,2,3,6-Tetra-O-galloyl-β-D-glucose (TGG), and 1,2,3,4,6-Penta-O-galloyl-β-D-glucopyranose (PGG), were validated through both in vitro assays and experiments using zebrafish models. Besides, the molecular docking analysis revealed that the potential inhibitors in MC could effectively inhibit COX-2 by interacting with specific residues, similar to the mechanism of action exhibited by celecoxib. In conclusion, BAUF-UPLC-MS combining the molecular docking is an efficient approach to discover enzyme inhibitors from traditional herbs and understand the mechanism of action.