  We present a novel dataset that extends our view of the cosmic gas around
z$\approx$3-4 Ly$\alpha$ emitting galaxies (LAEs) in the Muse Analysis of Gas
around Galaxies (MAGG) survey by tracing a cool and enriched gas phase through
47 MgII absorbers identified in newly-obtained VLT/XSHOOTER near-infrared
quasar spectra. Jointly with the more ionized gas traced by CIV systems and the
neutral HI from previous work, we find that LAEs are distributed inside cosmic
structures that contain multiphase gas in composition and temperature. All gas
phases are a strong function of the large-scale galaxy environment: the MgII
and the CIV strength and kinematics positively correlate with the number of
associated galaxies, and it is $\approx$3-4 times more likely to detect metal
absorbers around group than isolated LAEs. Exploring the redshift evolution,
the covering factor of MgII around group and isolated LAEs remains
approximately constant from z$\approx$3-4 to z<2, but the one of CIV around
group galaxies drops by z<2. Adding the cool enriched gas traced by the MgII
absorbers to the results we obtained for the HI and CIV gas, we put forward a
picture in which LAEs lie along gas filaments that contain high column-density
HI systems and are enriched by strong CIV and MgII absorbers. While the MgII
gas appears to be more centrally concentrated near LAEs, weaker CIV systems
trace instead a more diffuse gas phase extended up to larger distances around
the galaxies.
