I just proved that $M=\bigoplus_{i\in I}$ if and only if $M_i\cap \sum_{j\in I-\{i\}} M_j=\{0\}$. I have been warned that it is important that the intersection of $M_i$ and this sum is trivial (i.e. it is not enough to show that $M_i\cap M_j$ is trivial for all $i, j$).
I've been trying to find an example where this fails when you just have $M_i\cap M_j$ is trivial for all $i, j$. I tried constructing $M_1$, $M_2$, $M_3$ such that $M_i\cap M_j$ is trivial for all $i, j$ but $M_1\cap(M_2+M_3)$ isn't trivial using matrices but that turned out to be a dead end. If anyone could provide an example, hint, or a related article that I missed in scouring the stacks for something like this it would be appreciated!
Here is an example for vector spaces: $$V={\Bbb R}^2\ ,\quad V_1=span\{(1,0)\}\ ,\quad V_2=span\{(0,1)\}\ ,\quad V_3=span\{(1,1)\}\ .$$