We use results from simulations of the production of magnetohydrodynamic jets around black holes to derive the cosmic spin history of the most massive black holes. We assume that the efficiency of jet production is a monotonic function of spin a, as given by the simulations, and that the accretion flow geometry is similarly thick for quasars accreting close to the Eddington ratio and for low-excitation radio galaxies accreting at very small Eddington rates. We use the ratio of the comoving densities of the jet power and the radiated accretion power associated with supermassive black holes with Mbh>~10^8 Msol to estimate the cosmic history of the characteristic spin a. The evolution of this ratio, which increases with decreasing z, is consistent with a picture where the z~0 active galactic nuclei have typically higher spins than those at z~2 (with typical values a~0.35-0.95 and a~0.0-0.25 respectively). We discuss the implications in terms of the relative importance of accretion and mergers in the growth of supermassive black holes with Mbh>~10^8 Msol.