5. $\frac{1}{2}$.

From the problem, we have
$$
\begin{array}{l}
M N=\frac{\left|A A^{\prime}\right|+\left|B B^{\prime}\right|}{2}, \\
\frac{|B F|}{\left|B B^{\prime}\right|}=\sqrt{2}, \frac{|A F|}{\left|A A^{\prime}\right|}=\sqrt{2} .
\end{array}
$$

Thus, by the Cauchy-Schwarz inequality, we get
$$
\begin{array}{l}
\frac{|M N|}{|A B|}=\frac{1}{2 \sqrt{2}} \cdot \frac{|A F|+|B F|}{|A B|} \\
\leqslant \frac{1}{2 \sqrt{2}} \cdot \frac{\sqrt{2} \sqrt{|A F|^{2}+|B F|^{2}}}{|A B|}=\frac{1}{2} .
\end{array}
$$
5. Given that $F$ is the right focus of the hyperbola $x^{2}-y^{2}=1$, $l$ is the right directrix of the hyperbola, $A$ and $B$ are two moving points on the right branch of the hyperbola, and $A F \perp B F$. The midpoint of segment $A B$ is $M$, and the projection of $M$ on $l$ is $N$. Then the maximum value of $\frac{|M N|}{|A B|}$ is