This incident is narrated in Ghaybat Kubra from Abul Husayn bin Abul Baghl Katib who says, I took on a duty from Abu Mansur Ibne Salihan and then something happened between me and him that caused me to go into hiding.
Abu Mansur asked for me and threatened me. I waited in hiding with fear and then went to the graveyard of Quraysh in Baghdad on a Thursday night (Shabe Jumuah). I intended to spend the night there, praying and supplicating.
It was a windy and rainy night. I asked Abu Jafar, the custodian, to lock the doors and make sure no one remains there so I may pray and supplicate in solitude. Also I wanted to be safe from the evil of anyone because I was fearful.
He did that and locked the doors. Half past the night, the winds and rains were so powerful that they made sure no one came to the place. I stayed praying and reciting Ziyarat, and worshipping. As I was like that, I heard footsteps there before the tomb of Imam Musa (a). There was a man reciting Ziyarat. He greeted Hazrat Adam (as) and the other great prophets (as) and then the Imams (as), one after the other until he reached the name of Imam Mahdi (as) But he did not mention him by name. I wondered why and thought perhaps he has forgotten or he does not know or maybe this is his belief.
When he finished his Ziyarat, he offered two rakats of prayers. I was fearful of him, since I did not know him. He seemed a full young man, dressed in white clothes, wearing a turban with its end coming down under his chin and going over his shoulder, with braided hair, and had a cloak with long threads at its margins on his shoulder. He said, O Abu Husayn Ibne Abul Baghal, why are you not reading the supplication of Faraj?
I asked, and which supplication is that, my master?
He said, Pray two rakats, and say –
يَا مَنْ أَظْهَرَ الْجَمِيلَ، وَ سَتَرَ الْقَبِيحَ، يَا مَنْ لَمْ يُؤَاخِذْ بِالْجَرِيرَةِ، وَ لَمْ يَهْتِكِ السِّتْرَ،
يَا عَظِيمَ الْمَنِّ، يَا كَرِيمَ الصَّفْحِ، يَا حَسَنَ التَّجَاوُزِ، يَا وَاسِعَ الْمَغْفِرَةِ،
يَا بَاسِطَ الْيَدَيْنِ بِالرَّحْمَةِ، يَا مُنْتَهَى كُلِّ نَجْوَى، يَا غَايَةَ كُلِّ شَكْوَى،
يَا عَوْنَ كُلِّ مُسْتَعِينٍ، يَا مُبْتَدِئاً بِالنِّعَمِ قَبْلَ اسْتِحْقَاقِهَا
Translation: O He, Who reveals virtue, O He, Who conceals vice, O He, Who does not call to severe account for sins, O He, Who does not disclose the disgrace of His servants, O He, Who is the best forgiver, O He, Who overlooks errancy, O He, Whose forgiveness extends over all, O He, Whose Hands are stretched forth in mercy, O He, Who knows all secrets, O He, to Whom all complaints are directed. O helper of all those who seek help. O initiator of the bounties before one becomes deserving for them.
Then recite each of the following ten times:
يَا مُنْتَهَى رَغْبَتَاهْ
Translation: O Lord! O Chief! O Master! O final aim! O Limit of inclination!
أَسْأَلُكَ بِحَقِّ هَذِهِ الْأَسْمَاءِ، وَ بِحَقِّ مُحَمَّدٍ وَ آلِهِ الطَّاهِرِينَ إِلَّا مَا كَشَفْتَ كَرْبِي،
وَ نَفَّسْتَ هَمِّي، وَ فَرَّجْتَ عَنِّي، وَ أَصْلَحْتَ حَالِي
Translation: I ask You by the right of these names, and by the right of Mohammed and his purified progeny, that You remove my grief, dispel my sorrow, bestow success to me and improve my condition.
And then you ask for your desire and then you put your right cheek on the earth and say a hundred times in Sajdah –
يَا مُحَمَّدُ يَا عَلِيُّ، يَا عَلِيُّ يَا مُحَمَّدُ، اكْفِيَانِي فَإِنَّكُمَا كَافِيَايَ
وَ انْصُرَانِي فَإِنَّكُمَا نَاصِرَاي
Translation: O Mohammed! O Ali! O Ali! O Mohammed! Suffice me as you two are sufficers. Help me as you two are helpers.
And you place your left cheek on the earth and say a hundred times
and repeat it over and over and you say
until you run out of breath and then raise your head. Allah will fulfill your wish through His generosity.
As I applied myself to the prayers and supplications, he left.
When I was finished, I decided to go out to Abu Jafar to ask him about the man and how he had entered. I saw all the doors had been locked the way they were. I was perplexed much and thought perhaps he had spent the night there and I may not have realized. I found Abu Jafar, the custodian. He came out to me from the oil-room. I asked him about the gentleman and his entrance. He said, The doors are locked as you see them. I have not opened them.
I told him about the incident. He said, This is our master, Imam Mahdi – the Master of the Age, (as). I have seen him many times in the nights like this when the shrine is empty from the people.
I became much sad for the missed opportunity. I exited near dawn and went to Karkh towards the place where I was hiding. It was but the daybreak when men of Ibne Salihan were begging to meet me and were asking my friends about me.
They were carrying a letter of pledge of protection from the minister and a slip in his handwriting that had every pleasant thing. I went to him with a trustworthy friend of mine. He rose and embraced me and treated me in a way that I had never seen from him before. He said, Have things worsened so much for you that you had to complain about me to Imam Mahdi (as). I said, I simply prayed and supplicated.
He replied, I saw my master the Master of the Age in my dream last night. He meant the previous night – Thursday night. He was ordering me to do every good deed and expressed a dislike to me that frightened me.
I said: La Ilaaha Illallah! I bear witness that they are the truth and the pinnacle of righteousness. Last night I saw our master while I was awake. And he asked me to do such and such things.
Thus I explained to him what I had seen in the shrine.
He was astounded. He conferred great favors upon me with respect and I reached a level I did not anticipate. All this was from the blessings of our master, Imam Mahdi (as).
Muntahiul Aamal page 1141; Darus Salam Iraqi page 351; Najmus Saqib page 480; Sahifa Mahdaviyah (translation) page 121 quoting from Tabsiratul Waali page 192; Beharul Anwar volume 91 page 349; Dalaelul Imama page 551