Molecular docking is emerging as a pivotal tool in drug discovery. To improve efficiency, the ligand-receptor affinity predicted by molecular docking needs to be revised by using actual affinity data. Cell membrane chromatography (CMC), a biomimetic chromatographic technique, is frequently employed in the affinity evaluation of the ligand-membrane receptor. In this study, we developed an optimization approach by integrating CMC with molecular docking, specifically designed for the optimization of MrgX2 antagonists. In this study, we developed a "KD-r_psp_MMGBSA_dG_Bind_Lipo" approach by integrating CMC with molecular docking for the optimization of MrgX2 antagonists. Utilizing this approach, compound BER-5 was designed, synthesized, and demonstrated as a potent MrgX2 antagonist with antiallergic effects in vitro and in vivo. The successful application of this approach demonstrates its potential and rationality for further optimizing MrgX2 antagonists and holds promise for broader application in drug development targeting GPCRs on the membrane.