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$ reaches its maximum value, the x-coordinate of point $P$ is $\qquad$.
The center of the circle passing through points $M$ and $N$ lies on the perpendicular bisector of line segment $M N$, which is $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 fixed-length chord, the inscribed angle subtended by the major arc increases as the radius of the circle decreases. Therefore, when $\angle M P N$ is at its maximum, the circle $S$ passing through points $M$, $N$, and $P$ must be tangent to the $X$-axis at point $P$. This means that the value of $a$ in the equation of circle $S$ must satisfy $2(1+$ $\left.a^{2}\right)=(a-3)^{2}$. Solving this, we get $a=1$ or $a=-7$, corresponding to the points of tangency $P(1,0)$ and $P^{\prime}(-7,0)$, respectively.
The radius of the circle passing through points $M$, $N$, and $P^{\prime}$ is greater than the radius of the circle passing through points $M$, $N$, and $P$, so $\angle M P N>\angle M P^{\prime} N$. Therefore, the point $P(1,0)$ is the required point, and the x-coordinate of point $P$ is 1.