Coastal defenses on the site date to the late 17th century when shipbuilder William Pepperell acquired the property and erected crude defense works in 1689. Prior to that, the village was protected by Fort William and Mary at Portsmouth. The Province of Massachusetts Bay voted in 1715 to erect a permanent breastwork of six guns for the defense of the Piscataqua River, during the lead-up to Father Rale's War. Some sources state that it was intended to protect Maine from "unreasonable duties" that the governor of New Hampshire was attempting to impose on nearby citizens of other colonies. The fort was also used to collect duties from Massachusetts citizens for its own upkeep. This fortification was transferred to the United States government in 1803, known as Fort William, but none of its features are known to survive. The Pepperrells remained loyal to the British in 1775, so their property was confiscated by local Patriot forces, including the fort. In 1776, ammunition was provided for the fort's 9-pounder and 12-pounder cannon, and the New Hampshire militia manned the fort until 1779.
Second system period
Fort McClary was officially established in 1808 as part of the second system of US fortifications. It was named for New Hampshire native Major Andrew McClary, an American officer killed in the 1775 Battle of Bunker Hill. It consisted of a semi-elliptical lower battery of 9 or 10 guns and a shot furnace, and an upper battery near the present blockhouse whose armament does not appear in references. The fort was used throughout the 19th century, most notably during the War of 1812, but it saw no action.
The fort was further expanded in the 1840s, probably a consequence of tensions with Great Britain over the disputed border between Maine and New Brunswick which culminated in the bloodless Aroostook War and the 1842 Webster-Ashburton Treaty. The blockhouse was built in 1844 near the former upper battery; this was the last blockhouse built at a fort in Maine, and probably one of the last in a US coastal fort. The fort saw active use during the American Civil War, at which time it achieved much of its present structure due to a rebuilding under the third system that was never completed. The fort was manned near the start of the war by the Maine Coast Guard and the Kittery Artillery company, and in 1864 was also manned by the Maine State Guard. Its Civil War garrison notably included Vice PresidentHannibal Hamlin, who enlisted in Company A of the Maine State Guard as a private and served as a cook in the fort. Some subsequent citations erroneously confuse his unit with the Maine Coast Guard — including a plaque at the fort. The fort saw little action during the Civil War. A major rebuilding and expansion began in 1863 as part of the third system of fortifications, and the intent was to create a large five-sided fort with one or two tiers of cannon all around. However, only the seawalls were completed on the two seaward fronts, along with one of the landward cannon bastions with a granite magazine. The seawall was defended by a small caponier with rifle ports. Based on war experience, masonry forts were assessed as vulnerable to rifled cannon, and funding was withdrawn from all masonry fort projects in 1867, leaving Fort McClary with few cannon positions. A large number of granite blocks remain at the fort to this day.
Post Civil War to present
In the 1870s, the lower battery was rebuilt with three temporary gun positions for 10-inch Parrott rifles, but funding was again cut off with few other improvements. In the 1890s, nine 15-inch Rodman smoothbore guns and seven carriages were stored at the fort, to be mounted in case of war. Three of the Rodmans were mounted as an emergency measure in the Spanish–American War of 1898. The fort was superseded by the construction of Fort Foster and new batteries at Fort Constitution under the Endicott Program by 1901. By the 1910s, most of the fort had fallen into disrepair and it was officially decommissioned in 1918. The State of Maine acquired most the property from the federal government in 1924, after which it was managed as a park. Several of the dilapidated structures were demolished in the following decades. Parts of the fort were used by civilian defense forces during World War II. In 1969, it was placed on the National Register of Historic Places. The blockhouse and other structures were renovated in 1987, and the blockhouse serves as a museum.