8. Function
$$
y=\frac{m x^{6}+n x^{5}+4 x^{4}-\left(m x^{2}+n x\right)\left(x^{2}-1\right)-4 x^{2}+4}{x^{6}+1}
$$

has a minimum value of 1 and a maximum value of 6. Then $m+n=$
8. $3+2 \sqrt{6}$.

Transform the given function to get
$$
\begin{array}{l}
y=\frac{m x^{2}+n x+4}{x^{2}+1} \\
\Rightarrow(m-y) x^{2}+n x+4-y=0 .
\end{array}
$$

Consider it as a quadratic equation in $x$, by $\Delta \geqslant 0$ we get
$$
\begin{array}{l}
n^{2}-4(m-y)(4-y) \geqslant 0 \\
\Rightarrow 4 y^{2}-(4 m+16) y+16 m-n^{2} \leqslant 0 .
\end{array}
$$

Now consider it as a quadratic inequality in $y$, given that its solution set is $y \in[1,6]$, hence
$$
\left\{\begin{array} { l } 
{ \frac { 4 m + 1 6 } { 4 } = 1 + 6 , } \\
{ \frac { 1 6 m - n ^ { 2 } } { 4 } = 1 \times 6 }
\end{array} \Rightarrow \left\{\begin{array}{l}
m=3, \\
n=2 \sqrt{6} .
\end{array}\right.\right.
$$

Therefore, $m+n=3+2 \sqrt{6}$.