Stags fought back from 2-0 down inside 14 minutes to their Championship visitors to level five minutes from time.
But, just as the game looked to be slipping into extra-time, an cruel own goal settled it and halted the run of 10 wins in 11 games.
But Clough said the performance had reinforced just how good this side can be as they chase promotion.
“It was an unbelievably good cup tie and how well we played for 60-70 minutes of the game. It gives us a lot of encouragement,” he said.
“It takes 48 hours at least to sit back and look at it and think 'we played well on Saturday – really, really well at times'.
“We need to make more of the situations we are creating. Some of our play deserves more – more shots on target. We have to concentrate more on hitting the target.
“I think we had 15 shots on Saturday but only three on target. That tells its own story.
“But we are still averaging about two goals a game recently which is a very good sign. We're certainly trying to be as positive as we can with our play. Not too many teams have as much of an attacking intent as we have.”
He added: “Losing in the last minute like that is galling and heartbreaking.
“So much effort has gone into that 100 minutes we played. When you think you should get something from the game it's difficult to take.
“Chris Wilder said any Championship club would have struggled against us on Saturday and I think that's a good testament to how we played. He knew it wasn't going to be easy.
“It was just small margins that stopped us winning the game.”
A packed One Call Stadium made for a superb atmosphere and the home fans were delighted with their side's efforts.
“For the supporters to stay and give us an ovation, usually teams only get that when they win,” said Clough.
“But they recognised the credible effort that went in from the players and how close we were. They are enjoying the way we're trying to play.
“The worst feeling is not losing, it's not really having a go as a footballer, coming off the pitch thinking you could have done more.
“I don't think we could have done much more on Saturday in terms of effort.”
Painfully, Middlesbrough's reward was an away tie at Manchester United or Aston Villa but Clough wasn't sure if that meant Stags had missed out.
“I am never sure if it works like that,” he said.
“I don't know if we'd have been a different number or whatever.
“It would have been lovely to go to one of those grounds. But it wasn't to be.
“It wasn't through lack of effort. We were just a bit short on the day against Middlesbrough, but there were so many good things too.”
A brilliant solo effort from Uche Ikpeazu on four minutes and a debut goal for Caolan Boyd-Munce on 14 minutes had Boro in the box seat.
But Stags went up a gear after the break and Oli Hawkins deservedly headed them back into it on 67 minutes.
After Danny Johnson saw a finish ruled out for offside, a superb Jason Law through ball sent Rhys Oates away to level on 86 minutes.
But in the fifth added minute, Isaiah Jones's low cross was cruelly turned into the net by a combination of John-Joe O'Toole and Elliott Hewitt.