  We comprehensively study the potential for discovering lepton flavor
violation (LFV) phenomena associated with the $Z$ and Higgs bosons at the LHeC
and FCC-he. Our meticulous investigation reveals the remarkable suitability of
electron-proton colliders for probing these rare new physics signals. This is
due to the distinct advantages they offer, including negligible pileups,
minimal QCD backgrounds, electron-beam polarization $P_e$, and the capability
of distinguishing the charged-current from neutral-current processes. In our
pursuit of LFV of the $Z$ boson, we employ an innovative indirect probe,
utilizing the $t$-channel mediation of the $Z$ boson in the process $p e^- \to
j \tau^-$. For LFV in the Higgs sector, we scrutinize direct observations of
the on-shell decays of $H\to e^+\tau^-$ and $H\to \mu^\pm\tau^\mp$ through the
charged-current production of $H$. Focusing on $H\to e^+\tau^-$ proves highly
efficient due to the absence of positron-related backgrounds in the
charged-current modes at electron-proton colliders. Through a dedicated
signal-to-background analysis with the boosted decision tree algorithm, we
demonstrate that the LHeC with the total integrated luminosity of $1{\,{\rm
ab}^{-1}}$ can put significantly lower $2\sigma$ bounds than the HL-LHC with
$3{\,{\rm ab}^{-1}}$. Specifically, we find ${\rm{Br}}(Z\to e\tau)< 2.2 \times
10^{-7}$, ${\rm{Br}}(H\to e\tau) <1.7 \times 10^{-4} $, and ${\rm{Br}}(H\to
\mu\tau) < 1.0 \times 10^{-4}$. Furthermore, our study uncovers the exceptional
precision of the FCC-he in measuring the LFV signatures of the $Z$ and Higgs
bosons, which indicates the potential for future discoveries in this
captivating field.
