  We derive necessary optimality conditions for minimizers of regular
functionals in the calculus of variations under smooth state constraints. In
the literature, this classical problem is widely investigated. The novelty of
our result lies in the fact that the presence of state constraints enters the
Euler-Lagrange equations as a local feedback, which allows to derive the
$C^{1,1}$-smoothness of solutions. As an application, we discuss a constrained
Mean Field Games problem, for which our optimality conditions allow to
construct Lipschitz relaxed solutions, thus improving the existence result in
[Cannarsa, P., Capuani, R., \textsl{Existence and uniqueness for Mean Field
Games with state constraints}, arXiv:1711.01063].
