Tawassul (intercession) with the so called “dead” is not shirk. There are two opinions among the classical scholars when it comes to it: permissible (halal) and impermissible (haram).
Imam Ibn Hajar Al-Asqalani on Tawassul:
From the story of 'Abbas it follows that seeking intercession through the pious, the righteous and the Ahlul Bayt (family of the Prophet) is praiseworthy.
- Fathul Bari Sharh Sahih Bukhari, Page 577 under Hadith number 1010 of Sahih Bukhari
Shaykh al-Islam Imam al-Subki (رَحِمَهُ الله) said:
It should be known that Tawassul asking for help and intercession through the Prophet (ﷺ) in the court of Allah is not only allowed but is recommended. It being legal and recommended is a known fact for everyone who has understanding of Deen, this is a deed of Prophets/Messengers, the Salaf as-Saliheen, the Ulama and general public of Muslims.
None of them denied it nor in any time these deeds were called as bad except for when Ibn Taymiyyah (came into the picture) and he started to reject them, his sayings made the weak get into confusion/dilemma, he did such a Bidah which nobody before him had done.
- Shifa us Siqaam fi Ziyaratil Khayr il Anaam, Page 357.