Designing and regulating the metal ion adsorption sites is an effective strategy to improve the gas separation performance of porous materials. The diffusion behavior of gas molecules (H2, H2O, CO2, N2, CH4, SO2 and COS) confined in ion intercalated (Li+, Na+, K+, Rb+, Cs+, Mg2+ and Al3+) MXene nanoslits was studied by molecular dynamics method. The results showed that, due to the increase of steric hindrance after ion intercalation, the diffusion of gas molecules in confined nanoslits is subject to varying degrees of restriction. The diffusion coefficients of CO2, SO2 and COS, which interact strongly with metal ions, are significantly reduced, thus significantly improving the diffusion selectivity between these molecules and weakly interacting molecules (H2, N2 and CH4). In particular, Al3+, which has a high charge number and a small ionic radius, has a significant effect on improving the diffusion selectivity of mixed gases. The effect of metal ion intercalated MXene on the selectivity of the gas mixture is the result of the synergistic effect of adsorption and steric hindrance.