McCarthy was born in Brockton, Massachusetts to a shoemaker and his wife, who kept a boarding house. He was the only one of their three children to survive childhood. After an education in the public schools in Brockton, he was apprenticed to a shoemaker. When this did not interest him, he ran away to become a cabin boy on a sailing schooner. While at sea, he read the books available in the ship's library, obtaining the equivalent of a high school education.