6. Given $m \in\left\{x \mid \mathrm{e}^{x-1}+x^{3}-2=0\right\}, n \in\left\{x \mid x^{2}-a x-a+3=0\right\}$, and there exist $m, n$, such that $|m-n| \leqslant 1$, then the range of the real number $a$ is
A. $\left(2, \frac{7}{3}\right)$
B. $\left(\frac{7}{3}, 3\right)$
C. $\left[\frac{7}{3}, 3\right]$
D. $[2,3]$
Since the function $f(x)=\mathrm{e}^{x-1}+x^{3}-2$ is monotonically increasing, and $f(1)=0 \Rightarrow m=1$, thus $|n-1| \leqslant 1 \Rightarrow n \in[0,2]$, which means the equation $x^{2}-a x-a+3=0$ has a solution in $[0,2]$.
Then $a(x+1)=x^{2}+3 \Rightarrow a=\frac{x^{2}+3}{x+1} \xlongequal{t=x+1 \in[1,3]} \frac{t^{2}-2 t+4}{t}=t+\frac{4}{t}-2 \in[2,3]$.
Therefore, the answer is $D$.