McIlvaine was elected as a Whig to the Twenty-eighth, Twenty-ninth, and Thirtieth Congresses.
McIlvaine served as a representative for the Whig party during the sessions of the Twenty-eighth, Twenty-ninth, and Thirtieth Congresses.