It is the Gaelic vocative particle here, which is kinda like oh! in English oh, father!, oh, my friends!, but is (almost) always used when directly referring to somebody and it causes lenition of the following word.
So when you speak to James who goes by Seumas in Gaelic you address him directly with a Sheumais /ə heːmiʃ/ (oh) James! (hence the name Hamish in English – it basically is anglicized Gaelic vocative of James…).
It’s used almost always because it disappears before vowel, so (oh) father or father! is just athair and when addressing Anna you just say Anna (but in older writings you can see a athair or a Anna too – but before a vowel the a is never pronounced).
That's so interesting! Portuguese (Galician-Portuguese) has a Celtic substratum and it shares many characteristics and vocabularies with some Celtic languages. We also have that vocative particle to address someone we want to speak to. The particle can be either "Ô" (with a closed sound) or "Ó" (with an open sound) and it doesn't cause lenition of the following word. We use it all the time. I just don't know if it comes from the Celtic languages since I don't see it in any other Latin language nor even in Greek.