  We study the asymptotic behavior of solutions to the constrained MFG system
as the time horizon $T$ goes to infinity. For this purpose, we analyze first
Hamilton-Jacobi equations with state constraints from the viewpoint of weak KAM
theory, constructing a Mather measure for the associated variational problem.
Using these results, we show that a solution to the constrained ergodic mean
field games system exists and the ergodic constant is unique. Finally, we prove
that any solution of the first-order constrained MFG problem on $[0,T]$
converges to the solution of the ergodic system as $T \to +\infty$.
