McDonald played 19 games for Arizona after arriving in a deadline trade with second baseman Aaron Hill from Toronto. The 37-year-old served as a backup to Willie Bloomquist at shortstop with regular starter Stephen Drew on the disabled list with a broken ankle.
McDonald hit .169 with two doubles and two RBIs with Arizona and made the first postseason appearance of his 13-year big-league career in the NL Division Series against Milwaukee. McDonald will earn $1.5 million in each year of the deal.
Bloomquist declined his mutual option with Arizona, so McDonald could serve as Drew's backup or move to second base if the team is unable to re-sign Hill.