The design of an agile 5° irregular ring metamaterial for a 24-cavity relativistic magnetron with diffraction output (MDO) using single-stepped cavities for frequency switching is presented. By inserting six pieces of 5° irregular ring metamaterials in place of the traditional 5° vanes of a slow wave structure, the operating frequency can be tuned. When U = 400 kV high voltage is applied, with an applied magnetic field B = 0.36 T, the operating mode can be switched from the TE41 mode with a frequency of 2.585 GHz to the TE31 mode with a frequency of 2.282 GHz. The 24-cavity anode block is an electromagnetic medium which can support the operating mode working under its cutoff frequency, and the insertion of the irregular ring metamaterials alters its dispersion relation. The results suggest a new technique to achieve frequency agility by changing the dispersion relation of the electromagnetic system using a metamaterial unit cell. This work seeks to design a compact high power microwave source for a narrowband directed microwave wave beam that is suitable for frequency agility.