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$
Let $\odot C$ be the circle passing through $M, N$ and tangent to the $x$-axis, so point $P$ is the point of tangency between $\odot C$ and the $x$-axis. Since $k_{M N}=1$, then $M N: y=x+3 \Rightarrow A(-3,0)$. Using the power of a point theorem, we know $|A P|^{2}=|A M| \cdot|A N|=2 \cdot 2 \cdot 4=16 \Rightarrow x_{P}=1$