Vocative is the form of the name used when talking or writing to someone. English used to have one. "O ye of little faith" and "O Romeo Romeo" for example.
Mhairi is the vocative case and Gaelic speaking Scots would not put it on a girl's birth certificate. Her name would be Màiri, with Mhairi used in certain sentences to be gramatically correct. Nonetheless, non-Gaelic-speaking Scots have adopted Mhairi as a 'different', more modern version of Mary and it's now widely used.