It's because this;this
MVec MVec::operator+(const MVec &vec1) const { MVec ans; for(int i = 0; i < 3; i++) ans[i] = vec[i] + vec1[i]; return ans; } is defined to take only one argument.
It needs toshould be defined as a non-member function with the this MVec MVec::operator+(const MVec &vec1, const MVec &vec2) const definition. then you need to modify to add vec1[i] + vec2[i], assuming your goal is to add every value in the two vectors.
Also, you should add bounds checking. If either vector's length is less than three you're going to crash. You should either add up to the length of the shorter vector or not add them at all of the lengths aren't the same. example
int loopVar = 0; if (vec1.length() > vec2.length()) loopVar = vec2.length(); else loopVar = vec1.length(); for (int i = 0; i < loopVar; i++) ans[i] = vec1[i] + vec2[i];