To mitigate the shrinkage properties of ultra-high performance concrete (UHPC), MgO expansion agents (MEAs) with different activity levels (R-MEA, M-MEA, and S-MEA) were prepared and incorporated into UHPC. The effect of MEA activity on the mechanical properties and volumetric stability of UHPC were evaluated by using hydration heat tests, XRD-Rietveld quantitative analysis, MIP, X-CT and SEM. The results showed that MEA addition reduces the mechanical properties of UHPC, especially at high activity levels. However, it is beneficial for compensating early shrinkage. By combining MIP and X-CT analyses, it was found that MEA effectively increases the porosity of UHPC, with R-MEA (with the strongest activity) increasing it most. The w/b ratio had a greater effect on MEA hydration than the activity level. At lower w/b ratios, R-MEA reduced autogenous shrinkage even less effectively than M-MEA. Considering both the mechanical properties and shrinkage-reducing effect, it is recommended to prepare shrinkage-reducing UHPC with a w/b ratio of 0.18 and moderately reactive M-MEA.