6. Given the ellipse $\frac{x^{2}}{4}+y^{2}=1$ with left and right foci $F_{1}$ and $F_{2}$, respectively, and $M$ as a point on the ellipse other than the endpoints of the major axis, $\angle F_{1} M F_{2}=2 \theta$, and the incenter of $\triangle M F_{1} F_{2}$ is $I$. Then $|M I| \cos \theta=$ $\qquad$
$6.2-\sqrt{3}$.
Let the incircle of $\triangle M F_{1} F_{2}$ touch the sides $M F_{1}$ and $M F_{2}$ at points $D$ and $E$, respectively. Then
$$
M D=M E=\frac{1}{2}\left(M F_{1}+M F_{2}-F_{1} F_{2}\right) .
$$

Since $M D=2 M I \cos \theta$, we have
$$
M F_{1}+M F_{2}-F_{1} F_{2}=2 M I \cos \theta \text {. }
$$

In $\frac{x^{2}}{4}+y^{2}=1$,
$$
a=2, b=1, c=\sqrt{a^{2}-b^{2}}=\sqrt{3} \text {, }
$$

then $M F_{1}+M F_{2}=2 a=4$,
$$
F_{1} F_{2}=2 c=2 \sqrt{3} \text {. }
$$

Therefore, $|M I| \cos \theta=\frac{1}{2}\left(M F_{1}+M F_{2}-F_{1} F_{2}\right)$
$$
=\frac{1}{2}(4-2 \sqrt{3})=2-\sqrt{3} \text {. }
$$