He commanded his regiment in the expedition to Philadelphia in the American War of Independence, where he greatly distinguished himself at Germantown, one of Earl Cornwallis's outposts in front of Philadelphia, when the American army in great force attacked the village on the morning of 4 October 1777. Musgrave, with six companies of his regiment, threw himself into a large stone house, later known as Chew House, which he defended with great resolution against repeated attacks, until he was reinforced and the Americans repulsed. The action was commemorated by a silver medal, which was at one time worn as a regimental order of merit. The house is represented on the medal, and is the background of one of the engraved portraits of Musgrave in the British Museum Prints.
In 1781, he returned home as aide-de-camp to the king, and lieutenant-general of Stirling Castle. Cornwallis mentions him as at the reviews at Berlin in 1785 with Ralph Abercromby and David Dundas. On 12 Oct. 1787, Musgrave was appointed colonel of the new 76th Regiment of Foot or 'Hindustan' regiment, which was raised for service in India, by the East India Company. The rendezvous was at Chatham, and the recruits were chiefly from the Musgrave family estates in the north of England. Musgrave went out to India with it, and served on the staff at Madras for several years. He became a major-general, 28 April 1790. His hopes of a command against Tipu Sultan were disappointed by Lord Cornwallis, who appears to have thought that Musgrave did not work harmoniously with the civil government of Madras. Musgrave's plan of operations is published in 'Cornwallis's Correspondence. On his return Musgrave received many marks of attention from royalty. He was appointed governor of Chelsea Hospital, but exchanged with William Fawcett for that of Governor of Gravesend and Tilbury, which did not require residence. He became a lieutenant-general 26 June 1797, and general 29 April 1802; and being upon his death colonel of the 76th Regiment of Foot.
Death
He died in London on 31 Dec. 1812, aged 75, and was buried in the churchyard of St George's, Hanover Square, in which parish he had long resided. A portrait of Musgrave, painted by John White Abbott in 1786, was engraved and appeared in the 'British Military Panorama' in 1813. There is also a memorial to him at St. Kentigern's Church, Aspatria.
James was succeeded by his brother Sir William Musgrave, 10th baronet. He was born in 1792 at St Marylebone, educated at Westminster School, matriculated at Christ Church, Oxford where he received a Bachelor of Arts in 1813 and a Master of Arts two years later. He took Holy Orders and became Rector at Chinnor and eventually Emmington, Oxfordshire. He died unmarried on 30 September 1875, when the baronetcy became extinct.