12. In the Cartesian coordinate system $X O Y$, given two points $M(-1,2)$ and $N(1,4)$, point $P$ moves on the $X$-axis. When $\angle M P N$ takes its maximum value, the x-coordinate of point $P$ is $\qquad$
1
12.【Analysis and Solution】The center of the circle passing through points $M$ and $N$ lies on the perpendicular bisector of segment $M N$, which is the line $y=3-x$. Let the center of the circle be $S(a, 3-a)$, then the equation of circle $S$ is: $(x-a)^{2}+(y-3+a)^{2}=2\left(1+a^{2}\right)$.

For a chord of fixed length, the inscribed angle subtended by the major arc increases as the radius of the circle decreases. Therefore, when $\angle M P N$ is maximized, the circle $S$ passing through points $M, N, P$ must be tangent to the $X$-axis at point $P$, i.e., the value of $a$ in the equation of circle $S$ must satisfy $2\left(1+a^{2}\right)=(a-3)^{2}$. Solving this, we get $a=1$ or $a=-7$.

Thus, the corresponding points of tangency are $P(1,0)$ and $P(-7,0)$. Since the radius of the circle passing through points $M, N, P$ is greater than the radius of the circle passing through points $M, N, P'$, we have $\angle M P N > \angle M P' N$. Therefore, the point $P(1,0)$ is the desired point, so the x-coordinate of point $P$ is 1.