They seem to only do their stun attack on mounted players. If you hear/see one coming towards you, dismount immediately. Theyll fly around you a bunch but wont stun you.

More Microraptor Encountering Tips