We investigate the sensitivity of the projected TeV muon collider to the gauged $L^{}_{mu}$-$L^{}_{tau}$ model. Two processes are considered: $Z$-mediated two-body scatterings $mu^+ mu^- to ell^+ ell^-$ with $ell = mu$ or $tau$, and scattering with initial state photon emission, $mu^+ mu^- to gamma Z,~Z to ell overline{ell}$, where $ell$ can be $mu$, $tau$ or $ u_{mu/tau}$. We quantitatively study the sensitivities of these two processes by taking into account possible signals and relevant backgrounds in a muon collider experiment with a center-of-mass energy $sqrt{s} = 3~{rm TeV}$ and a luminosity $L=1~{rm ab^{-1}}$. For two-body scattering one can exclude $Z$ masses $M^{}_{Z} lesssim 100~{rm TeV}$ with $mathcal{O}(1)$ gauge couplings. When $M^{}_{Z} lesssim 1~{rm TeV} <sqrt{s}$, one can exclude $g gtrsim 2times 10^{-2}$. The process with photon emission is more powerful than the two-body scattering if $M^{}_{Z} < sqrt{s}$. For instance, a sensitivity of $g simeq 4 times 10^{-3}$ can be achieved at $M^{}_{Z} = 1~{rm TeV}$. The parameter spaces favored by the $(g-2)^{}_{mu}$ and $B$ anomalies with $M^{}_{Z} > 100~{rm GeV}$ are entirely covered by a muon collider.