John McDonnell has threatened to send Jeremy Corbyn to Buckingham Palace in a taxi to tell the Queen Labour is “taking over” if Boris Johnson loses a no-confidence vote.

The shadow chancellor’s comments at Edinburgh Fringe Festival on Wednesday suggested that MPs attempting to block a no-deal Brexit would involve the monarch if they ran out of options.

Mr McDonnell said Labour would ask the Queen to appoint party leader Mr Corbyn as prime minister if Mr Johnson refused to step down.

He said he did not want to “drag the Queen into this” but would “send Jeremy Corbyn in a cab to Buckingham Palace to say we’re taking over”.

Prominent pro-EU Tory MP Dominic Grieve previously warned the prime minister that he could not ignore constitutional convention, adding that the Queen “is not a decorative extra” and may be forced to “dispense with his services herself”.

Boris Johnson's cabinet: Who's in and who's out Show all 40 1 /40 Boris Johnson's cabinet: Who's in and who's out Boris Johnson's cabinet: Who's in and who's out In: Jacob Rees-Mogg Jacob Rees Mogg appointed Leader of the Commons AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Esther McVey Esther McVey appointed housing secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Jo Johnson Jo Johnson appointed new business and energy secretary EPA Boris Johnson's cabinet: Who's in and who's out In: Brandon Lewis Brandon Lewis appointed immigration secretary Getty Boris Johnson's cabinet: Who's in and who's out In: James Cleverly James Cleverly appointed Conservative Party chairman PA Boris Johnson's cabinet: Who's in and who's out In: Baroness Evans Baroness Evans remains Leader of Lords PA Boris Johnson's cabinet: Who's in and who's out In: Julian Smith Julian Smith appointed Northern Irish secretary Reuters Boris Johnson's cabinet: Who's in and who's out In: Alister Jack Alister jack appointed Scottish secretary PA Boris Johnson's cabinet: Who's in and who's out In: Alun Cairns Alun Cairns remains Welsh secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Grant Shapps Grant Shapps appointed transport secretary Getty Boris Johnson's cabinet: Who's in and who's out In: Alok Sharma Alok Sharma appointed international development secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Robert Buckland Robert Buckland appointed justice secretary Getty Boris Johnson's cabinet: Who's in and who's out In: Amber Rudd Amber Rudd remains work and pensions secretary Getty Boris Johnson's cabinet: Who's in and who's out In: Robert Jenrick Robert Jenrick appointed housing and communities secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Andrea Leadsom Andrea Leadsom appointed business secretary Reuters Boris Johnson's cabinet: Who's in and who's out In: Nicky Morgan Nicky Morgan appointed culture secretary Getty Boris Johnson's cabinet: Who's in and who's out In: Gavin Williamson Gavin Williamson appointed education secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Theresa Villiers Theresa Villiers appointed environment secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Liz Truss Liz Truss is appointed international trade secretary Reuters Boris Johnson's cabinet: Who's in and who's out In: Ben Wallace Ben Wallace appointed defence secretary EPA Boris Johnson's cabinet: Who's in and who's out In: Stephen Barclay Stephen Barclay remains EU secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Dominic Raab Dominic Raab appointed foreign secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Priti Patel Priti Patel appointed home secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out In: Michael Gove Michael Gove given Chandellor of the Duchy of Lancaster AFP Boris Johnson's cabinet: Who's in and who's out In: Sajid Javid Sajid Javid is appointed Chancellor of the Exchequer AP Boris Johnson's cabinet: Who's in and who's out Out: Jeremy Hunt Jeremy Hunt sacked as foreign secretary Reuters Boris Johnson's cabinet: Who's in and who's out In: Matt Hancock Matt Hancock remains health secretary AFP/Getty Boris Johnson's cabinet: Who's in and who's out Out: Chris Grayling Chris Grayling resigned as transport secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: Jeremy Wright Jeremy Wright sacked as culture secretary PA Boris Johnson's cabinet: Who's in and who's out Out: Karen Bradley Karen Bradley sacked as Northern Ireland secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: James Brokenshire James Brokenshire sacked as housing and communities secretary Reuters Boris Johnson's cabinet: Who's in and who's out Out: Penny Mordaunt Penny Mourdaunt sacked as defence secretary Reuters Boris Johnson's cabinet: Who's in and who's out Out: Liam Fox Liam Fox sacked as international trade secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: Greg Clarke Greg Clarke sacked as business secretary PA Boris Johnson's cabinet: Who's in and who's out Out: David Mundell David Mundell sacked as Scottish secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: Damien Hinds Damien Hinds sacked as education secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: David Gauke David Gauke resigned as justice secretary EPA Boris Johnson's cabinet: Who's in and who's out Out: Rory Stewart Rory Stewart resigned as international development secretary Getty Boris Johnson's cabinet: Who's in and who's out Out: David Lidlington David Lidlington resigned as deputy Prime Minister PA Boris Johnson's cabinet: Who's in and who's out Out: Philip Hammond Philip Hammond resigned as Chancellor of the Exchequer AFP/Getty

It is expected Mr Corbyn will table a motion of no confidence in the autumn to prevent a no-deal Brexit, and some senior Tory MPs have suggested they could vote against Mr Johnson’s new government as a last resort.

In a letter to The Times, former Conservative foreign secretary Sir Malcolm Rifkind said Mr Johnson could spark “the gravest constitutional crisis since the actions of Charles I led to the Civil War” if he “refused to respect the normal consequence of losing a confidence vote” and “sought to prevent both parliament and the electorate having a final say on no deal”.

Mr McDonnell’s comments came after it was revealed Mr Johnson could refuse to resign and wait a fortnight for a general election to be triggered.

Support free-thinking journalism and attend Independent events

Under the Fixed-term Parliaments Act 2011, MPs have 14 days to form an alternative government and win a fresh vote before a general election must be called.

A cross-party group of rebel MPs are reportedly looking into how they can prevent Mr Johnson pushing through a no-deal Brexit on 31 October, according to The Guardian.