SOLVED: Error encountered when signing in

What fixed this for me was opening the Xbox Console Companion app. It required me to authenticate, and once I did that, MCC started working.

Hope this helps someone.

You must mean for pc.