McClaren saw Johnny Russell come off the bench to score the goal that earned Derby's first home league win of the season and the first for six months.
But Leeds hit the woodwork twice and could easily have ruined McClaren's return to the club that sacked him 17 months ago.
Until Russell pounced, there was little in the game and Leeds should have been in front by then after skipper Kyle Bartley thumped a header against the bar from a corner in first-half stoppage time.
It was from a corner that Derby scored in the 56th minute when Leeds could only get the ball away to the edge of the area and Russell raced in to drive a low shot past Rob Green.
Leeds pressed hard in the closing stages and almost equalised in the fifth minute of added time when substitute Marcus Antonsson curled a shot from just inside the box past Scott Carson but the ball came back off a post.
"I think you could see the nervousness of the players but amongst that nervousness the players showed fight, the attitude was great and we got some great blocks in at the end," McClaren said.
"We worked our socks off and we needed that second goal and we have to learn that. The last 10 minutes was always going to be nervous but we rode our luck and got through it and it was a big three points.
"We said we need to put a marker down at five o'clock and we have done. I saw certain aspects I like and potential in the team but there is a lot of work, a lot of work, and a long way to go but if the players have that attitude and fight, I have no complaints.
"That's what we said at the beginning not just at half-time, what do the supporters want to see, they want to see your fight, attitude, tackles and I think the players did that."
Leeds head coach Garry Monk was frustrated not to get anything from the game.
"I said to the players at half-time that we need to put our game on the pitch a little bit better and we came out and we started to do that and then we conceded a poor goal from our point of view which put us on the back foot," he said.
"We had a go in the last 25 minutes and had a couple of chances but overall I think we didn't do enough of the things we have done really well in recent games with the ball to give ourselves the best chance of getting something.
"We probably deserved something from the game but it's one of those where you probably can't complain that you didn't. We didn't do enough of the good things that we have been doing recently to really carve them open or create really clear opportunities.
"We hit the woodwork a couple of times and were probably the wrong side of those margins but the pleasing thing for me is we are still very competitive in games and were fighting for the result right up to the very end."