He traveled over the Territory twice a year, attending courts, in many instances prosecuting for the Territory, and looking after such civil business as came in his way, as well as conducting the business of the United States, which kept him busily occupied. Having an extensive practice and becoming weary of so much travel, he settled in Seattle in 1864, and declined a reappointment, although he was not relieved until the following year. He was the first resident attorney who settled in Seattle, and for many years was on one side of nearly every case on the docket. John McGilvra served as the founding president (1886-1889) of the King County Bar Association. He practiced his profession in King and adjoining counties until about 1890, when he withdrew from the firm of McGilvra, Blain & DeVries, and retired from practice. He maintained a primary residence in Seattle until his death in 1903, although he traveled extensively in the United States and Europe. McGilvra served one term in the Territorial Legislature of 1866–67, and during the session procured an appropriation of US$2,500 for a wagon road across the Cascade Mountains through the Snoqualmie Pass. This amount was supplemented by an appropriation of like amount from King County and by later appropriations and contributions the road was kept open, and for many years was the only means of communication across the Cascade Mountains north of the Columbia River. In 1873, immediately after the location of the Northern Pacific Railway terminus at Tacoma, Washington Judge McGilvra, with others, proceeded to organize the Seattle & Walla Walla Railroad Company. He drew the articles of incorporation and all the papers and documents connected with that enterprise, and served as the attorney of the incorporation some two years without compensation. The people of Seattle, entirely unaided by capital from abroad, constructed and put into operation twenty-one miles of road from Seattle to Newcastle, Washington coal mines. Subsequently they carried another branch of road up the Cedar River to the Black Diamond and Franklin coal mines. That enterprise, which was undertaken at a critical time in the history of Seattle, had the effect to stay the confidence of the citizens, and assisted materially in building up the town in spite of all opposition, and the discrimination against it by the Northern Pacific Railroad. In 1876 the Northern Pacific Railroad abandoned its northern line, the Skagit Branch through Skagit Pass (now known as Cascade Pass), and located its road south of Mount Rainier, through what was known as Packwood or Cowlitz Pass.