We present the goals, design, and first results of the MUSE Ultra Deep Field (MUDF) survey, a large programme using the Multi Unit Spectroscopic Explorer (MUSE) instrument at the ESO Very Large Telescope. The MUDF survey is collecting ≈ 150 hours on-source of integral field optical spectroscopy in a 1.5 × 1.2 arcmin 2 region which hosts several astrophysical structures along the line of sight, including two bright z ≈ 3.2 quasars with close separation (≈ 500 kpc). Following the description of the data reduction procedures, we present the analysis of the galaxy environment and gaseous properties of seven groups detected at redshifts 0.5 < z < 1.5, spanning a large dynamic range in halo mass, log(M h /M ) ≈ 11 − 13.5. For four of the groups, we find associated Mg ii absorbers tracing cool gas in high-resolution spectroscopy of the two quasars, including one case of correlated absorption in both sightlines at distance ≈ 480 kpc. The absorption strength associated with the groups is higher than what has been reported for more isolated galaxies of comparable mass and impact parameters. We do not find evidence for widespread cool gas giving rise to strong absorption within these groups. Combining these results with the distribution of neutral and ionised gas seen in emission in lower-redshift groups, we conclude that gravitational interactions in the group environment strip gas from the galaxy haloes into the intragroup medium, boosting the cross section of cool gas and leading to the high fraction of strong Mg ii absorbers that we detect.