Retired Navy Cmdr. Samuel Johnson McKee, 76, a veteran of World War II who later worked as a technical writer and systems analyst, died of cancer Wednesday at Arlington Hospital.

Cmdr. McKee was a communications officer on the cruiser U.S.S. Raleigh during the Japanese attack on Pearl Harbor, when the ship was severely damaged. He later commanded one of the first surface ships to arrive at Nagasaki after it was partially destroyed in August 1945, by the second atomic bomb ever used in warfare.

He was born in Steubenville, Ohio. After graduating from the Naval Academy at Annapolis in 1926, he received his Navy commission and was assigned to China, Japan and Central America. He also served at naval installations in this country before his retirement in 1952.

Cmdr. McKee then became a systems analyst for the development of the Polaris nuclear missle and worked as a technical writer for military and government agencies and for local corporations. He retired a second time in the mid-1960s.

He lived in Arlington and was an active member of the U.S. Naval Academy Alumni Association.

Cmdr. McKee's marriage to the former Ida Mae Posey ended in divorce.

Survivors include his wife, Grace Beatrice of Arlington; two daughters by his first marriage, Marianne M. Withers of Richmond, and Leslie S. Carls of Burke; a brother, James, of Pompton Plains, N.J.; two sisters, Anna Mary Gorby of Steubenville and Henriea McKee of Columbus, Ohio, and seven grandchildren.

The family suggest that expressions of sympathy be in the form of contributions to the American Cancer Society.