EU leaders and MEPs have given a cautious welcome to the draft Brexit deal struck between the EU and the UK but warned it faced major hurdles in the British and European parliaments and could take time to ratify.

France’s president, Emmanuel Macron, praised the agreement, saying it “allows us to respond to the political and technical concerns that both we and the British share”, but said it was up to the British prime minister to get it through the House of Commons.

He said he was “reasonably confident this can be ratified by a vote of the British parliament”, but added that “based on past experience, we have to be reasonably cautious … History tells us parliaments may not like the agreement.”

A visibly happy Angela Merkel told reporters in Brussels that achieving the deal had been “real hard work.”

The German chancellor called the agreement “a compromise for all sides” but noted that it contains key demands from the EU side, including maintaining the integrity of the common market and preserving the Good Friday Agreement. She called it “an opportunity to have good, close relations with Britain in future as well.”

Asked whether the EU’s apparent refusal to consider a further extension undermines the UK Parliament, Merkel said: “We will address any decision by the British Parliament and didn’t make any decision today for any eventuality.”

The Irish taoiseach, Leo Varadkar, said the agreement would allow the UK to leave the EU in an “orderly way”. The backstop had been replaced, he added, and its alternative “does what we need it to do: avoids a hard border between north and south, protects the all-Ireland economy, protects the single market and our place in it”.

However, he pointed out the deal still needed to be discussed by EU leaders at the summit and approved by the European parliament, and declined to say what might happen if it were voted down in the Commons on Saturday. “The best thing we can do in Ireland … is not intervene or interfere in UK internal politics,” Varadkar said.

Luxembourg’s prime minister, Xavier Bettel, said he hoped MPs would approve the agreement “because it’s not now people are in favour of Brexit or against Brexit, it’s really not the matter, it’s really now if we are going to have a deal or no deal”.

He added: “[The UK] understands that not having a deal is not good for them either. So I hope they are reasonable on Saturday morning in London, and I hope also that they’ll see that it’s in the interests of everyone to say yes.”

The Dutch prime minister, Mark Rutte, said he was hopeful the agreement would pass its Commons test on Saturday. “It looks encouraging. Of course we have to take a look at the details, but it seems all the red lines of the British and Europe have been met,” he said.

The Croatian prime minister, Andrej Plenković, said he hoped Brexit had been solved “but we remain prudent”, while his Latvian counterpart, Arturs Kariņš, said things “look very promising” but “I guess it will be up to the British parliament”.

The incoming European commission president, Ursula von der Leyen, who is due to take over from Jean-Claude Juncker at the end of November, said it was important Brexit happened “in an orderly way, as that’s decisive for people and for the economy. It’s also decisive for the starting point of the future relations we’ll have with Britain.”

But she said she was cautious about whether Johnson could secure a Commons majority, and one of her new vice-presidents, Frans Timmermans, said he had “stopped trying to predict what the British parliament will think of it”.

MEPs also advised caution. The European parliament president, David Sassoli, said the parliament was ready to “do its duty” and examine and ratify the deal by 31 October, once it had secured the backing of the UK parliament.

But the parliament’s Brexit coordinator, Guy Verhofstadt, told a meeting of his parliamentary group that while the draft accord “safeguards the single market, safeguards the values of the EU, and avoids a border on the island of Ireland … the question for the moment is: will the British parliament agree?”

The leader of the centre-right European People’s party grouping, Manfred Weber, said it would, before approving the deal, “closely scrutinise the details. Our principles are clear: no cherrypicking of the internal market, avoiding a hard border and protecting citizens’ rights.”

The German Green party’s EU affairs spokeswoman also advised all member states to look carefully at the single market rules and how they would be applied under the deal. “Northern Ireland cannot become a huge dumping zone and tax haven,” she said.

And Jens Geier, a German Social Democrat, told Politico the European parliament was unlikely to come to any formal decision until the withdrawal agreement had been approved in both the Commons and the House of Lords, possibly pushing final confirmation back to November.