The adviser said that Pakistan remained committed to support efforts for lasting peace and stability in Afghanistan.
The visit came as President Donald Trump's administration is preparing to unveil its new Afghan war strategy later this month amid allegations sanctuaries on Pakistani soil are helping the Taliban sustain and intensify the insurgency.
According to Pakistan's Foreign Ministry, McCain, leading a five-senator delegation in the capital Islamabad, made the remarks during a meeting with Pakistani foreign policy adviser Sartaj Aziz.
Senator John McCain, chairman of the U.S. Senate's Armed Services Committee, Sunday said there was no change in Washington's Kashmir policy despite the designation last week of a key pro-freedom Kashmiri leader as a "global terrorist".
The move instantly invited ire from Islamabad, which rejected the USA decision, saying the 70-year-old indigenous struggle of Kashmiris in Indian-occupied Jammu and Kashmir remains legitimate.
"Pakistan reiterated to the U.S. senators that military solution is no option in Afghanistan and as it has been tried in past by the North Atlantic Treaty Organisation and Centcom forces without any success", the official said.
Pakistan was also upset at the recent USA arms deal with India signed during the visit of Indian Prime Minister Narendra Modi to Washington. "The U.S. will continue to pursue its [traditional] Kashmir policy", McCain was quoted as saying by state-run Pakistan Television, citing Foreign Ministry officials.
McCain calls Pakistan a 'close' friend, ally of US
The adviser told the visitors Pakistan looked forward to a "constructive" engagement with the United States on efforts aimed at promoting a stable and prosperous Afghanistan. Adviser noted that QCG process remains a credible and effective vehicle to facilitate reconciliation and restore peace, stability and economic prosperity in Afghanistan.
"There is no change in USA policy on Kashmir".
The adviser underscored the significance of the longstanding cooperation between the two countries and the need to make this partnership diverse and multidimensional.
During the meeting, Aziz said that the strategic partnership between Pakistan and the USA is of utmost importance to achieve peace and stability in the region.
He said that Pakistan was also ready to strengthen and deepen its partnership with the USA to counter the new and emerging terrorism threats including the expanding footprint of Da'ish in the region.
Speaking to media, he said India has failed to suppress the voice of Kashmiris through "use of force and brutal human rights violations".