Sayyiduna ‘Ali ibn Abi Talib, Alayhis Salam, himself narrated that the Messenger of Allah ﷺ said:
“I am the city of wisdom and ‘Ali is its gate.” and there is another Hadith which gives clear evidence that both the ‘city of knowledge’ and ‘house of wisdom’ versions of the above Hadith were existent in the Sunan of Imam at-Tirmidhi.
This Hadith is in the Sunan of Imam at-Tirmidhi, in the al-Mustadrak alas Sahihayn of Imam al-Hakim an-Nishapuri, in the Ad-Durar al-Muntatharah fi al-Ahadith al-Mushtahirah by Imam Jalaluddin as-Suyuti.
‘Abdullahi ibn ‘Abbas, Radi’Allahu Ta’Ala Anhu, also narrated this and it can be found related by Imam al-Hakim, and Imam At-Tabarani in ‘Mujam Al-Awsat’, The Greater Collection.
Mullah Ali Qari, Rahmatullahi Alayhi, says in his Al-Mirqat fi Sharh al-Mishkat,
“It is proven that The Hadith of ‘I am the city of knowledge and ‘Ali is its gate’ was narrated by Imam al-Hakim in the Kitab al-Manaqib in his al-Mustadrak from ‘Abdullahi ibn ‘Abbas.”
Imam al-Hakim goes on to say:
“The chain I narrate is a Sahih Hadith.”
Imam ad-Daraqutni said:
“This is a proven [Thabit] Hadith, and Imam at-Tirmidhi narrated it, meaning the Hadith in his Kitab al-Manaqib in his al-Jami’.”
Hafiz ibn Hajar said:
“The truth of this Hadith is that it has a degree of good/somewhat sound [In this case he is saying the Hadith is classified as Hasan], it is not raised to rigorously authentic nor is it to be degressed to a forgery.”
Shaykhul Islam – Imam Ahmad ibn Hajar al-Haytami Al-Makki explains this in his As-Sawa’iq al-Muhriqah.