James McMillan Shafter (May 27, 1816 – August 29, 1892) was an American politician who served in Vermont, Wisconsin, and California.
Born in Athens, Vermont, Shafter graduated from Wesleyan University and was admitted to the Vermont bar. In 1841, he served in the Vermont House of Representatives and from 1842 to 1849, Shafter was the Secretary of State of Vermont. In 1850, he moved to Sheboygan, Wisconsin and was elected to the Wisconsin State Assembly. In 1852, Shafter served as speaker of the Assembly. In 1856, he then moved to California where he practiced law and raised cattle and horses. In 1862, Shafter served in the California State Senate and was President Pro Tempore of the California Senate. Shafter also served in the California Constitution Convention of 1878 and was on the University of California Board of Regents ex offico as President of the California State Agricultural Association. In 1889, Shafter was judge of the San Francisco County Superior Court.
McMillan served on the first Board of Trustees of Stanford University, beginning in 1891.