2. If the function $f(x)=\frac{2^{x+1}}{2^{x}+1}+\sin x$ has a range of $[n, M]$ on the interval $[-k, k](k>0)$, then $M+n$ $=$ $\qquad$
2. 2 .

Notice that
$$
f(x)=\frac{2^{x+1}}{2^{x}+1}+\sin x=1+\frac{2^{x}-1}{2^{x}+1}+\sin x \text {. }
$$

Let $g(x)=f(x)-1$. Then
$$
g(-x)=\frac{2^{-x}-1}{2^{-x}+1}+\sin (-x)=\frac{1-2^{x}}{1+2^{x}}-\sin x=-g(x)
$$

is an odd function.
Let the maximum value of $g(x)$ be $g\left(x_{0}\right)$. By the given information, we have
$$
g\left(x_{0}\right)=M-1 \text {, }
$$

and $g\left(x_{0}\right) \geqslant g(x)(x \in[-k, k])$.
Thus, $-g\left(x_{0}\right) \leqslant-g(x)=g(-x)(x \in[-k, k])$, which means $-g\left(x_{0}\right)$ is the minimum value of $g(x)$. Therefore,
$$
-g\left(x_{0}\right)=n-1 \text {. }
$$

Adding the maximum and minimum values of $g(x)$, we get
$$
0=(M-1)+(n-1) \Rightarrow M+n=2 \text {. }
$$