"If military action has to be taken to prevent sarin gas to be used, Congress has to be involved," McCain said.
But Sen. Rand Paul, R-Ky., said it was a "bad idea to discuss contingency plans for war."
The amendment specified that it should not be construed as a declaration of war or an authorization to use force.
Last year, Obama and congressional Republicans agreed on nearly $500 billion in defense cuts over 10 years. If the two sides fail in the next month to avert the "fiscal cliff" the Pentagon would face an additional $55 billion in automatic, across-the-board cuts after the first of the year.
Not far from the Capitol, a coalition of retired military leaders, administration officials and lawmakers pleaded with the president and Congress to address the nation's debt, calling it the greatest threat to national security. The group of prominent Republicans and Democrats said the United States can spend less on defense while still maintaining its military superiority.
"A strong economy and strong national security are inextricably linked," said retired Adm. Mike Mullen, the former chairman of the Joint Chiefs of Staff.
The administration has threatened to veto the Senate bill, strongly objecting to a provision restricting the president's authority to transfer terror suspects from the U.S. prison at Guantanamo Bay, Cuba, to foreign countries. The provision is in current law.
The Senate also voted to restrict the transfer of detainees held at Guantanamo to prisons in the United States.
Further stoking the debate over U.S. detention policy â¿¿ and setting up a fight with the House â¿¿ the Senate also added a provision saying the government may not detain a U.S. citizen or legal resident indefinitely without charge or trial even if there is a declaration of war or the authorization to use military force.