High-intensity neutrino beams are an essential tool to study neutrino physics. Both neutrino oscillation experiments and cross-section measurements require a precise prediction of the neutrino flux. MINERvA is a dedicated on-axis high-statistics neutrino-nucleus scattering experiment in the NuMI beamline at Fermilab with an intensive campaign to study the neutrino flux. We performed several in-situ measurements using the medium energy neutrino beam with an energy peak of approximately 6 GeV to better understand the neutrino flux and control the systematic flux uncertainties. We used the analysis of charged-current neutrino interactions with low hadronic recoil to measure parameters of the neutrino flux model which suggested that the energy scale for muons reconstructed in the MINOS detector needed to be shifted by 3.6%. Furthermore, we reduced the flux uncertainty by measuring the precisely known purely leptonic process of elastic (anti)neutrino scattering off atomic electrons. Additionally, we measured the inverse muon decay with a neutrino energy threshold of ~11 GeV to constrain the high-energy part of the flux. The combination of the measurements resulted in the overall reduction of the flux uncertainty from 7.6% to 3.3% in the neutrino beam, and from 7.8% to 4.7% in the antineutrino beam.