He served on the Atlantic blockade stations and Mississippi River patrols during the American Civil War, rising to the rank of rear admiral in July 1898.
By 14 June, as a unit of Destroyer Squadron 54 (DesRon 54), she was in the screen for the battleships that opened their guns against Japanese shore installations on Saipan.
From 6–21 September, she supported the land forces effecting the capture and occupation of the southern Palaus with counterbattery and harassing fire.
Arriving in the Leyte Gulf transport area on 20 October, McNair took up antisubmarine patrol duty to protect ships and troops as the latter began to storm the shore at Dulag.
In the first hours of the 25th, she remained at her station to cover the entrance to Leyte Gulf as her sister ships of DesRon 54 conducted their much-heralded night torpedo attack on Japanese men-of-war steaming toward the northern end of Surigao Strait and defeat under the guns of Rear Admiral Jesse B. Oldendorf’s battleline.
McNair remained off Okinawa to aid in fighting off the daily air attacks until 27 April, when she returned to Ulithi for repairs.
The force steamed north on 1 July, and for the next month and a half ranged the coasts of the enemy's home islands, raining destruction on industrial and military targets on Honshū, Hokkaidō, and the Kuriles.
On 6 September 1952, she departed her home port, Newport, R.I., for a world cruise that took her through the Panama Canal to Korea, where she served as gunfire support ship for United Nations troops and as guardian of carriers of the 7th Fleet.
After 3 months in the combat area, she transited the Suez Canal en route home, arriving Newport 11 April 1953.
In July she headed back across the Atlantic for a midshipman training cruise to northern Europe, followed by her first deployment with the 6th Fleet in the Mediterranean.
In June 1958, McNair again sailed eastward to help deal with another explosive situation in the politically unstable eastern Mediterranean area.
By 7 September, she had resumed her status as a Naval Reserve training ship and had returned her reservist crew to civilian life.