  Three-dimensional microwave waveguide cavities are essential tools for many
cavity quantum electrodynamics experiments. However, the need to control
quantum emitters with dc magnetic fields inside the cavity often limits such
experiments to normal-conducting cavities with relatively low quality factors
of about $10^4$. Similarly, controlling quantum emitters with dc electric
fields in normal- and superconducting waveguide cavities has so far been
difficult, because the insertion of dc electrodes has strongly limited the
quality factor. Here, we present a method to apply dc electric fields within a
superconducting waveguide cavity, which is based on the insertion of dc
electrodes at the nodes of the microwave electric field. Moreover, we present a
method to apply dc magnetic fields within the same cavity by trapping the
magnetic flux in holes positioned in facing walls of the cavity. We demonstrate
that the $\text{TE}_{301}$ mode of such a superconducting, rectangular cavity
made from niobium maintains a high internal quality factor of $Q_{\text{int}}
\sim 1.7 \cdot 10^6$ at the few photon level and a base temperature of
$3~\text{K}$. A cloud of Rydberg atoms coupled to the microwave electric field
of the cavity is used to probe the applied dc electric and magnetic fields via
the quadratic Stark effect and the Zeeman effect, respectively.
