  We investigate the existence of an optimal policy to monitor a mean field
systems of agents managing a risky project under moral hazard with accidents
modeled by L\'evy processes magnified by the law of the project. We provide a
general method to find both a mean field equilibrium for the agents and the
optimal compensation policy under general, sufficient and necessary assumptions
on all the parameters. We formalize the problem as a bilevel optimization with
the probabilistic version of a mean field games which can be reduced to a
controlled McKean-Vlasov SDE with jumps. We apply our results to an optimal
energy demand-response problem with a crowd of consumers subjected to power
cut/shortage when the variability of the energy consumption is too high under
endogenous or exogenous strains. In this example, we get explicit solution to
the mean field game and to the McKean-Vlasov equation with jumps
