From 1980 to 1983, he was Deputy Chief of Mission at the United States Embassy to Zaire (now the Democratic Republic of the Congo) in Kinshasa.
He held this post until 1991, at which time President George H. W. Bush appointed him as Special Assistant to the President for National Security Affairs and Senior Director for International Programs and African Affairs on the staff of the National Security Council.
McNamara became Principal Deputy Assistant Secretary of State for Political-Military Affairs in July 1993, and then, following nomination by President Bill Clinton and Senate confirmation, became Assistant Secretary of State for Political-Military Affairs on October 12, 1994.
Following the September 11 attacks, McNamara, as an expert in counter-terrorism, returned to government service as Senior Advisor for Counter Terrorism and Homeland Security to the Secretary of State until July 2004.
Following passage of the Intelligence Reform and Terrorism Prevention Act of 2004, President George W. Bush on March 15, 2006, appointed McNamara Program Manager for the Information Sharing Environment reporting through the Director of National Intelligence to the President and the Congress.