The fluxgate magnetometer MGF on board the Mio spacecraft of the BepiColombo mission is introduced with its science targets, instrument design, calibration report, and scientific expectations. The MGF instrument consists of two tri-axial fluxgate magnetometers. Both sensors are mounted on a 4.8-m long mast to measure the magnetic field around Mercury at distances from near surface (initial peri-center altitude is 590 km) to 6 planetary radii (11640 km). The two sensors of MGF are operated in a fully redundant way, each with its own electronics, data processing and power supply units. The MGF instrument samples the magnetic field at a rate of up to 128 Hz to reveal rapidly-evolving magnetospheric dynamics, among them magnetic reconnection causing substorm-like disturbances, field-aligned currents, and ultra-low-frequency waves. The high time resolution of MGF is also helpful to study solar wind processes (through measurements of the interplanetary magnetic field) in the inner heliosphere. The MGF instrument firmly corroborates measurements of its companion, the MPO magnetometer, by performing multi-point observations to determine the planetary internal field at higher multi-pole orders and to separate temporal fluctuations from spatial variations.