According to Al Arabiya News, the only two countries with a fully operational embassy in Afghanistan at the moment are China and Russia:
Russian and Chinese embassies are the only diplomatic missions functioning normally in Afghanistan and are being guarded by Taliban militants.
Russia is in contact with Taliban officials via its embassy in Kabul, President Vladimir Putin’s special representative on Afghanistan said on Monday, a day after the Afghan government collapsed and the capital fell to the extremist group.
China has said that it is willing to develop ‘friendly relations’ with the Taliban. Chinese Foreign Ministry spokesperson said that Beijing hopes the Taliban will unite various parties and ethnic groups to ensure peace in Afghanistan.
The foreign ministry also said that its embassy in Afghanistan is operating normally and the Chinese Ambassador to Afghanistan is still in Kabul and safe.
As pointed out to me in a comment, other countries in the region may also have diplomatic presence. Some examples:
Pakistan, according to gulfnews.com, as of August 15th:
The crisis deepened in Afghanistan on Sunday with Taliban forces taking over Kabul. As the Taliban negotiators entered the presidential palace for a peaceful transfer of power, Kabul-based embassies and consulates of international countries started closing down telling their nationals to leave the country.
The Pakistan embassy, however, was open to facilitate the travel services to the Pakistani, the Afghan and the citizens of other nations. Ambassador Mansoor Ahmad Khan asked the media requiring visas to contact the Press Counselor assuring they would be facilitated.
Iran, according to al-monitor.com as of August 17th:
Iran's Foreign Ministry spokesman Saeed Khatibzadeh said the country's embassy in Kabul continues its normal operations two days after the lightning capture of the Afghan capital by the Taliban. Khatibzadeh said the Islamic Republic's consulate in the city of Herat, close to the Iranian border, also remains fully operational.
The statement confirmed earlier reports that Iran's embassy was among a handful of foreign missions still open despite the mayhem, including the embassies of Russia, China and Pakistan, countries which have signaled possible recognition of an emerging Taliban-controlled Afghanistan.
Turkey, according to ANI News:
Ankara [Turkey] August 29 (ANI/Sputnik): The Turkish Embassy in Afghanistan was relocated back to its premises in Kabul after it was temporarily stationed at the Kabul airport, Turkish President Recep Tayyip Erdogan said on Sunday.
"Two weeks ago our embassy was temporarily relocated to the Kabul airport. Yesterday, they [embassy staff] returned to their headquarters in the centre of Kabul and resumed their work there. Our plans are to maintain our diplomatic presence in Afghanistan. We are constantly monitoring the development of the security situation and have options ready just in case. Our priority is the safety of our personnel," Erdogan said as quoted by Turkish NTV broadcaster.
That doesn't mean there are no other diplomats in the country. For example, the new Dutch embassy team just arrived in Kabul on August 18th to help evacuations. According to a tweet by Dutch Minister of Foreign Affairs Kaag:
Het nieuwe ambassadeteam is zojuist aangekomen in #Kabul om het evacuatieproces uit #Afghanistan verder te begeleiden. Dit team bestaat uit ambassadeur Caecilia Wijgers, een consulair noodteam en 62 militairen. Het team dat zij afwisselen is inmiddels terug in Nederland.
That translates to:
The new embassy team has just arrived in #Kabul to guide the evacuation process from #Afghanistan. This team consists of Ambassador Caecilia Wijgers, an emergency consular team and 62 military members. The team they replace is back in the Netherlands now.
I don't think there are many other European diplomats in Afghanistan other than to help with the evacuation of their citizens and Afghans who are allowed to leave with them (e.g. because they are not safe on account of having helped allied forces).
On July 8th, 2021 US President Biden said he intends to maintain a diplomatic presence. I don't know if that's still the US position. From whitehouse.gov:
I intend to maintain our diplomatic presedence [presence] in Afghanistan, and we are coordinating closely with our international partners in order to continue to secure the international airport.