John McDonnell looks exhausted, slumped in his parliamentary office chair. Nobody said the revolution would be easy. Do he and Jeremy Corbyn have any catchphrases, I ask, to gee themselves up when battered by the right-wing press, the pundits or the moderates in their own party? ‘This will send the Daily Mail wild, OK,’ he says. ‘It’s Gramsci: “Pessimism of the intellect, optimism of the will.”

‘No matter how bad it gets, determination is what you need. We’re doing something we’ve been working for for 30, 40 years of our lives. And this opportunity has come. We didn’t expect it. But now it’s come we’re making the most of it.’

Hours before our interview, Labour’s Treasury team had one of their regular meetings with the former head of the civil service, the crossbencher Lord Kerslake. They’ve been meeting active civil servants, the heads of the Treasury and HMRC, and I’m told McDonnell has ‘a good working relationship’ with Mark Boleat, the former City of London Corporation policy chief. The drive is to assure everyone that — contrary to the expectations of many — Corbyn’s Labour is prepared for government.

‘The first 100 days will be radical,’ says McDonnell. ‘Within months we’d have our first Budget. We’d be into our Finance Bill a month after that and we’d be setting up the National Investment Bank. We’ll start investing in our housing programme. We’d be scrapping tuition fees. Jeremy laid out the priorities for civil servants about what we’d want in our first Queen’s Speech. It would be a radical laying of the foundation stones for the next five years.’

On Brexit, he says that Labour’s priority would be to ‘protect the economy and protect jobs… we don’t underestimate the mess we’ll be inheriting’. What if Labour found itself in power before March 2019, and the Article 50 deadline for withdrawal from the EU? He doesn’t blink at the idea, but stays away from the technicalities: ‘We’ve built in a transition period, so that will give us a bit of stability… We feel whatever the state of play will be, we’ll be able to secure a better deal with Europe or use that transition period to prepare the future.’

How extraordinary it is to hear McDonnell talking so confidently about real power. Just two and a half years ago Jeremy Corbyn’s faction of MPs, the Socialist Campaign Group, didn’t dare to dream that it could seize the leadership of the party, let alone the country. The Labour leadership had put up barriers intended to stop a hard-left candidate from getting to the starting block: every candidate needed the support of at least 15 per cent of the party. In June 2015 that meant 35 MPs — significantly more than the Campaign Group had. They had 12 days.

Much has been said about Corbyn’s surprise successes; how he denied the Tories a majority in this election and vastly expanded Labour’s membership, making it impossible for him to be ousted in a coup by his MPs. But to McDonnell, the most significant victory was the first: the operation that won over enough MPs for Jeremy Corbyn, a serial rebel with a 1970s script, to be nominated. After that, political currents which no one has yet quite understood swept him to the leadership.

McDonnell takes much of the credit for getting Corbyn on the Labour ballot. One of his first moves was to bring in Ben Sellers, a bookseller in Durham who was to become their digital guru. Sellers converted his bookshop into Team Corbyn’s social media HQ and his success was instant. A new Facebook page, organising and discussing campaigning techniques, received 10,000 ‘likes’ and 2,000 ‘shares’ within the first few hours. On the @JeremyCorbyn4PM Twitter account, the hashtag #JezWeCan, coined as a joke by a rival campaign’s supporter, was adopted with alacrity. Sellers reckons that his online efforts influenced ten to 15 MPs who nominated Corbyn — a third of the total required.

But with three days to go, and only 18 nominations in writing, McDonnell feared they would fall short. He ordered volunteers from around the country to assemble in one room in Westminster for the weekend for the political equivalent of a lock-in without the booze. McDonnell explains how they tested the strength of prospective nominees.

‘We hit the telephones. We could listen in to conversations about who had spoken to whom, how firm they were on the nomination, and if they weren’t firm, we’d make an assessment about who else we could speak to. Sometimes it was speaking to a relative or friend or whatever and getting a report back and we were all doing odds on how reliable these nominations were.’

By 6 p.m. on the Sunday, as McDonnell left for a long-standing date at the Globe theatre, he felt he had received sufficient support to take Corbyn over the line. That evening, the shadow chancellor watched ‘a very bloody Shakespeare play, blood all over the place’. McDonnell says he can’t remember which play it was. Funnily enough, a quick Google reveals the answer to be King John, a tale of ruthless politicking and fatal power struggles. Perhaps the title appealed to him.

At 11 a.m. the next day, with an hour to go, things were getting tense. McDonnell was waiting for another nine MPs to make their way to Labour’s office in Westminster Hall to physically sign the nomination papers.

Finally, those who had pledged to support Corbyn started turning up. With around three minutes to go, Corbyn still had not secured the requisite 35 votes. McDonnell was reduced to sinking to his knees in front of an audience of four prevaricating MPs. He told them the party membership would not understand or forgive if Jeremy was excluded from the ballot. ‘I was very emotional,’ he tells me. It worked. As Big Ben struck 12 noon, Corbyn was on the ballot with 36 MPs backing him. From there, as everybody knows, he stormed to the leadership and in June this year, almost to No. 10.

Now Corbyn has cemented his position at the top of the party after confounding so many expectations, I asked McDonnell why Corbyn had succeeded where he and Diane Abbott had failed as leadership contenders. Is he more likeable?

‘Yes. He’s not a confrontational politician. He’s a consensus builder. I am more confrontational and Diane is a bit as well. Jeremy’s whole history has been around very principled stands, and even where people have been ardently disagreeing with him, they have respected his view.’

Does McDonnell worry, as his comedy character does on the BBC sketch show Tracey Breaks the News, that Jeremy is being distracted by his celebrity? He laughs: ‘Jeremy’s feet are firmly on the ground. Don’t underestimate his ability to stay rooted. He refuses to accept celebrity status. [His popularity] is just wonderful. It’s an emotional commitment from so many young people.’

Not everybody thinks it is fantastic. Many Labour MPs fear Momentum, the driver of all that youthful enthusiasm. Are they not taking over Labour and purging it of its diversity? McDonnell says that since Corbyn won the second leadership election, the party has come together in an ‘amazing way… The atmosphere has transformed.’

‘People in Momentum have their views and they express them and articulate them. But we’ll always be a party with different ideas stretching right the way from left to right. That includes whether it’s Momentum, Progress, the Fabian Society. You name it.’

But what about the coercing of Labour MPs to sign a loyalty pledge? McDonnell bats the question away as if it’s fake news. ‘There’s no way Momentum is demanding a loyalty pledge. They’re asking Labour MPs to uphold a sort of ethics formula.

‘What Momentum did in the last general election was literally have thousands of people moving from constituency to constituency to support people and they did that on the basis of where that support was needed. It wasn’t on the basis of what the politics of that individual MP is. It’s just mobilising. They’re not asking for anything in return.’

John McDonnell may be tired, but his spirits are strong, and his will optimistic.

'Don't underestimate Jeremy's ability to stay rooted. He refuses to accept celebrity status'

Mark Lobel’s report on the 12 days that changed politics is on the Westminster Hour on BBC Radio 4 this Sunday at 10 p.m.