Although engaged in the administration of Queen Mary (of Guise) he remained a committed Protestant. He occupied the manse in Flisk, an estate three miles south of Cupar in Fife. His successor as Lord Clerk Register, James Balfour, later Lord Pittendreich, previously held the manse in Flisk.
MacGill was appointed Lord Clerk Register of Scotland when Mary of Guise formed her administration in 1554. On 25 May 1557 he was one of a delegation who met with Mary I of England's delegation near Carlisle by the Water of Sark. There, in the run-up to Peace of Cateau-Cambresis, he proposed that the Scots would not break any peace treaty with England to appease French interests. MacGill was a commissioner for the final negotiation of the Peace at the Kirk of Steill in May 1559, called the Treaty of Upsettlington.
During the crisis of the Scottish Reformation, MacGill and John Bellenden of Auchnoul searched the records of Scotland to find precedents for trying Regent Arran and his son James Hamilton, 3rd Earl of Arran, who had joined the Protestant cause, for treason. Yet by August 1559, he had secret meetings with the English commander and Captain of Berwick, Sir James Croft, saying that the Queen Regent's council were mostly joined with the Protestants. However, on 25 November 1559, he asked for the keys of Edinburgh Castle on behalf of the Regent, and was refused. Later, during the Siege of Leith he remained with the Queen Regent at Edinburgh Castle.
When Mary returned to Scotland in 1561 she appointed MacGill a Privy Councillor. MacGill was unhelpful to the English agent Thomas Randolph when he requested details of the divorce of Margaret Tudor and the Earl of Angus, the grandparents of Lord Darnley. After the murder of David Riccio, the Papal Nuncio advised the removal of six men from Court to restore peace, including Bellenden and MacGill, described as "a man of no family and contriver of all evil". After Mary escaped to England, MacGill was one of the party who produced the casket letters at York which were alleged to implicate Mary in the death of her husband Lord Darnley. He attended Elizabeth I and her Council at Hampton Court in late October 1568.
In 1570 MacGill was reluctantly appointed Provost of Edinburgh. In November 1571, during the War between Leith and Edinburgh when Mary's supporters held Edinburgh Castle, MacGill was sent with Robert Pitcairn, Commendator of Dunfermline to negotiate with Henry, Lord Hunsdon at Berwick upon Tweed. MacGill asked for 8 cannons, 3000 footmen and pikemen, and support for 1000 Scots troops, in the cause of the "maintenance and protection of the true religion to the confusion of those that now goes about to disturb the same". MacGill had a particular interest in the siege as the "registers and records of the chief matters" were held in Edinburgh Castle with the Scottish Crown jewels, by Mary's supporters. In 1572 the force holding Edinburgh Castle led by William Kirkcaldy of Grange and known as the "Castilians" twice destroyed MacGill's stronghouses in Edinburgh, and while the siege lasted the Burgh Council met in exile at Leith.
Regent Morton wrote to MacGill in 1575 asking him to re-negotiate a gold and silver mining contract with the Dutch engineer Cornelius de Vos. A portrait painter working in Scotland at this time, Arnold Bronckorst, was associated with Cornelius and Nicholas Hilliard. Morton also obtained passports for MacGill's sons, John and David, to travel to France to continue their studies.
MacGill's wife, Janet Adamsoun or Adamson was a noted Protestant. John Knox wrote to her from Lyon in 1557 as one of his "sweet sisters". His letter mentions that he had previously written to her on the subject of "what duty a wife owes her husband"; Knox said he had referred the matter to John Calvin.
When Janet wrote to Thomas Randolph, an Englishman, in April 1583, she reminded him of her husband's "duty and good service to his country, together with his love and maintenance of peace, unity, and concord betwixt our two nations, whenever the occasion was offered here, or when he was employed and sent in commission to your country".