 McKee was elected as an Unconditional Unionist to the Thirty-ninth Congress (March 4, 1865 – March 3, 1867).He successfully contested as a Republican the election of John D. Young to the Fortieth Congress and served from June 22, 1868, to March 3, 1869.He was not a candidate for renomination in 1868.