Striker MacDonald and midfielder Hardie played little part in Saints' first top-flight season for seven years after their injury-plagued spells at McDiarmid Park continued.
MacDonald told his club's official website: "I'm delighted to get a contract and I'm determined to repay the gaffer for his faith in me.
"Obviously, when you're injured and going out of contract, it's a worry but I'll be back for pre-season and it can't come soon enough for me."
Hardie added: "Everybody knows I've been out quite a long time. At least my future's sorted.
"It's now up to myself to prove to people like the gaffer upstairs that I'm going to be back fit and playing again."
Boss Derek McInnes said: "Peaso will be ready for pre-season and Martin should be back in September. They have both been good servants and shown their value in the SPL."