The flat-spectrum radio quasar 4C $+$71.07 is a high-redshift ($z=2.172$), $gamma$-loud blazar whose optical emission is dominated by the thermal radiation from accretion disc. 4C $+$71.07 has been detected in outburst twice by the AGILE $gamma$-ray satellite during the period end of October - mid November 2015, when it reached a $gamma$-ray flux of the order of $F_{rm E>100,MeV} = (1.2 pm 0.3)times 10^{-6}$ photons cm$^{-2}$ s$^{-1}$ and $F_{rm E>100,MeV} = (3.1 pm 0.6)times 10^{-6}$ photons cm$^{-2}$ s$^{-1}$, respectively, allowing us to investigate the properties of the jet and of the emission region. We investigated its spectral energy distribution by means of almost simultaneous observations covering the cm, mm, near-infrared, optical, ultra-violet, X-ray and $gamma$-ray energy bands obtained by the GASP-WEBT Consortium, the Swift and the AGILE and Fermi satellites. The spectral energy distribution of the second $gamma$-ray flare (the one whose energy coverage is more dense) can be modelled by means of a one-zone leptonic model, yielding a total jet power of about $4times10^{47}$ erg s$^{-1}$. During the most prominent $gamma$-ray flaring period our model is consistent with a dissipation region within the broad-line region. Moreover, this class of high-redshift, large-mass black-hole flat-spectrum radio quasars might be good targets for future $gamma$-ray satellites such as e-ASTROGAM.