Mr McDonnell said any deal with the Conservatives would have to give MPs a vote on holding a referendum with the option to remain in the EU, as shadow cabinet colleagues said it would be “very difficult” to reach an agreement at all.
The government has said talks between the two parties must conclude by midweek in order to avoid European elections at the end of the month. If a compromise deal based on continued membership of the EU customs union remains out of reach, further indicative votes in the Commons may need to be held.
Following devastating local election results, the Prime Minister issued a plea to MPs urging them to “break the deadlock” and get a Brexit deal through parliament.
The Prime Minister said she understood why Tory MPs found the decision to hold talks with Labour “uncomfortable”, and admitted it was not what she wanted either. But she said the crushing blow voters delivered on both parties at the ballot box had given “fresh urgency” to the need to end the impasse.
Mrs May urged Labour leader Jeremy Corbyn to work with her to reach a deal, writing in the Mail on Sunday: “To the leader of the opposition, I say this: let’s listen to what the voters said in the elections and put our differences aside for a moment. Let’s do a deal.”
And the Scottish Conservative leader Ruth Davidson added her voice to appeals for compromise. “We’ve gotten pretty close, we’re getting closer and closer to where that middle ground might be,” she told the BBC’s Andrew Marr programme.
“I would urge my colleagues in the House of Commons to start taking those first steps to walk back to something in the middle because we need to allow the country to move on.”
But Mr McDonnell played down hope of a breakthrough, accusing Mrs May of jeopardising cross-party talks for her own “personal protection”.
Following newspaper reports that Mrs May is preparing to give ground this week in the discussions, the Labour frontbencher said the PM had “blown the confidentiality” of the negotiations.
He said his party wanted to get a deal done “as soon as possible” but needed guarantees that an agreement would not be “ripped up” by a future Conservative leader.
Mr McDonnell accused Mrs May of acting in “bad faith” after the Sunday Times reported that the Prime Minister would put forward plans for a comprehensive but temporary customs arrangement with the EU that would last until the next general election.
Mr McDonnell said it “may well” be the case that any deal would have to be voted on in a second referendum, adding: “I think the Conservatives have to recognise that if a deal is going to go through there might be a large number of MPs who will want a public vote.”
Earlier, shadow health secretary Jon Ashworth said it was “disappointing” that it appeared Tory ministers and spin doctors had been “briefing about what’s happening” in the talks.
And Labour’s deputy leader Tom Watson said it would be “very difficult” to agree a deal in the cross-party talks.
A letter signed by 104 opposition MPs, including dozens of Labour parliamentarians as well as senior figures in the SNP and Liberal Democrats, warned Mr Corbyn against agreeing a deal without a second referendum.
“The very worst thing we could do at this time is a Westminster stitch up,” the letter says. “This risks alienating those who voted leave in 2016 and those who voted remain.”
Elsewhere, Brexit Party leader Nigel Farage warned Mrs May against agreeing to stay in the EU customs union, telling the Telegraph that she would be “going into coalition with the opposition against the people”.
Sir Graham Brady, the chairman of the 1922 committee of Tory backbenchers, told the same paper that staying in a customs union could lead to a “catastrophic split” in the party at a time when Labour is led by “dangerous extremists”.