  We investigate mean field game systems under invariance conditions for the
state space, otherwise called {\it viability conditions} for the controlled
dynamics. First we analyze separately the Hamilton-Jacobi and the Fokker-Planck
equations, showing how the invariance condition on the underlying dynamics
yields the existence and uniqueness, respectively in $L^\infty$ and in $L^1$.
Then we apply this analysis to mean field games. We investigate further the
regularity of solutions proving, under some extra conditions, that the value
function is (globally) Lipschitz and semiconcave. This latter regularity
eventually leads the distribution density to be bounded, under suitable
conditions. The results are not restricted to smooth domains.
