They have the cap space and McD did play well - at times.
His $4 million a year deal is 62nd for all LBers in 25. There will be other contracts in the next few months so he will drop on the list.
PFF gave him a mediocre grade of 56.1. That's 137th out of 189 LBers. That doesn't justify the deal he got but he was 45th in tackles and snap count.
It appears to be a reasonable contract.