This matter is permissible because to merely call or ask someone for something, does not count as worshipping other than Allah. Similarly, to merely say “O Messenger of Allah” is not associating partners with Allah. It is confirmed that Bilal ibn al-Harith approached the grave of the Prophet in the year of the Ramadah (drought), during the caliphate of ^Umar and said, “O Messenger of Allah ask Allah for rain for your nation as they are in ruins.” (Related by al-Bayhaqiyy and others.)
Neither ^Umar nor anyone else denounced his words. In fact they praised his act. Surat An-Nisa’, Ayah 64 means, “If only, when they are unjust to themselves, they come to you and ask Allah for forgiveness, and the Messenger asks forgiveness for them, Allah will forgive them and have mercy upon them.” An additional proof is in the hadith related by al-Bukhariyy in Al-Adab Al-Mufrad, which reveals that when ^Umar’s leg became paralyzed, he said, “O Muhammad” in his call for help-to which his call was answered with a cure.