The following is taken from the Kashf al-Mahjūb by the great Persian Sufi master Alī Hujvīrī (d. 1077). He identifies Muhammad al-Baqir as one of the greatest Imams of the Islamic faith and includes him among the ranks of the elite of the people of knowledge.
Among the Imams is the Proof (al-Ḥujja) and the Clear Evidence [of guidance], the Imam of the descendants of the Prophet, and the elect from the progeny of ‘Alī b. Abī Ṭālib, Abū Ja‘far Muhammad b. ‘Alī b. al-Ḥusayn b. ‘Alī b. Abī Ṭālib (may God be pleased with them all). He was also famously known as Abū ‘Abd Allāh and was given the title al-Bāqir. He was distinguished for his knowledge of the higher forms of knowledge and his grasp of the subtleties and mystical allusions within the Qur’an. There are famous saintly miracles attributed to him and clear proofs [attesting to his saintly status].
It is related that on one occasion a king, who wished to destroy him, summoned him to his presence. When he [al-Bāqir] entered into the king’s presence, the king begged his pardon and offered him gifts and dismissed him courteously. The king was asked why he had behaved thusly with an individual that he had sought to destroy. To this inquiry, the king replied: “When he entered, I saw one lion on either side of him and they were telling me: if you mean him any harm, we shall destroy you.’”
It is also related that in interpreting the following words of God: “Whosoever rejects false idols/evil (al-ṭāghūt) and believes in God” [Q. 2: 256], he said: “Anything that prevents you from contemplating the Truth is your ṭāghūt.” Thus, anything that veils the Truth and turns you away from it would be considered evil.
One of his close companions related that when a portion of the night had passed and he had finished his night vigil prayers, he would raise his voice and cry aloud to God: “O God, O my Lord! Night has come and the power of monarchs has ceased; the stars have appeared in the sky and all mankind are asleep and silent; and the Banū Umayya have gone to rest and shut their doors and set guards to watch over them; and those who desired anything from them have forgotten their business. You, O God, are indeed the Living, the Lasting, the Seeing, the Knowing. Sleep and Slumber cannot overtake thee. The one who does not testify to this about You is not worthy of Your bounty. O You, whom nothing withholds from anything, whose eternity is not impaired by Day or Night, whose doors of Mercy are open to all who call upon You, and whose entire treasures are lavished upon those who praise You. Verily, You never turn away the beggar, and no creature on earth or heaven can prevent the true believer who implores You from gaining access to Your court. O Lord, when I remember death and the grave and the Judgment, how can I take joy in this world? Therefore, since I acknowledge You to be One, I beseech You to give me peace in the hour of death, without torment, and pleasure in the hour of reckoning, without punishment.” He would say all this while weeping in sincerity, until I told him one night: ‘O my lord, and lord of my fathers! Why do you weep and why do you cry?’ He replied to me: ‘O my friend, when Jacob lost his son [Joseph], he cried so much that he lost his sight! As for me, I have lost 18 members of my family, in addition to my father—referring to al-Ḥusayn and those slaughtered at Karbala—so it is only fitting that my eyes be whitened because of the tears I shed for being parted from them.’”
[‘Alī Hujvīrī, Kashf al-Mahjūb (Cairo, 2007), Vol. I: 281–283]