Such loaded, tendentious, terms:
American imperialism - Was planning and doing Cuban independence in 1903 "American imperialism"?
(C)onsolidating the country's position as a global power - Seriously? During McKinley's Presidency the US Army was tiny, and the US Navy was inferior to the navies of Britain, France, and Russia (when McKinley died the USN had 9 battleships, all of which were significantly smaller than the RN's 8 Royal Sovereign, 9 Majestic class, and 5/6 Canopus class battleships). The USN did not become world-class until the 1910s and 1920s, and the US Army really did not break its roller-coaster-like swell-and-shrink cycling until WW2 or even Korea.
His presidency was soon overshadowed by the outbreak of the Spanish-American War in 1898 - Seriously? Overshadowed? It was perhaps the major event in McKinley's Presidency, what's with the dark adjective?
McKinley also oversaw the annexation of Hawaii and advocated for the construction of the Panama Canal, cementing America's position as a major global power. - Besides the lesser size of the USN's major ships and its fleet as a whole, the USN had two oceans in which it had to operate, and pre-Panama-Canal, moving ships from one ocean to the next was a long voyage through inhospitable seas. The voyage of USS Oregon during the Spanish American War and consequent refit before being committed to battle illustrates this. Another reason the USN was not a "major global power" in 1898 and for long afterward was that it lacked its own coaling stations for long voyages, and would only slowly develop such resources - Hawai'i, Guam, and the Philippines - over the first couple of decades of the 20th Century.