  The interaction of jets in High-Mass X-ray Binaries (HMXBs) with the strong
winds driven by the hot companion star in the vicinity of the compact object is
fundamental to understand the jet dynamics, non-thermal emission and long-term
stability. However, the role of the jet magnetic field in this process is
unclear. We study the dynamical role of weak and moderate-to-strong toroidal
magnetic fields during the first hundreds of seconds of jet propagation,
focusing on the magnetized flow dynamics and the mechanisms of energy
conversion. We have developed the code L\'ostrego v1.0, a new 3D RMHD code to
simulate astrophysical plasmas in Cartesian coordinates. Using this tool, we
performed the first 3D RMHD numerical simulations of relativistic magnetized
jets propagating through the clumpy stellar wind in a HMXB. The overall
morphology and dynamics of weakly magnetized jet models is similar to previous
hydrodynamical simulations, where the jet head generates a strong shock in the
ambient medium and the initial over-pressure with respect to the stellar wind
drives one or more recollimation shocks. In the time scales of our simulations,
these jets are ballistic and seem to be more stable against internal
instabilities than jets with the same power in the absence of fields. However,
moderate-to-strong toroidal magnetic fields favour the development of
current-driven instabilities and the disruption of the jet within the binary. A
detailed analysis of the energy distribution in the relativistic outflow and
the ambient medium reveals that both magnetic and internal energies can
contribute to the effective acceleration of the jet. We certify that the jet
feedback into the ambient medium is highly dependent on the jet energy
distribution at injection, where hotter, more dilute and/or more magnetized
jets are more efficient, as anticipated by feedback studies in the case of jets
in active galaxies.
