O'Keefe, 25, has played 66 games in the Championship and 14 in the top flight with the Bluebirds and former club Crystal Palace.
However, he has been limited to 10 appearances for Cardiff this season.
"I'm delighted to get Stuart in. He'll bring energy to the team and good experience for someone still relatively young," said Dons boss Robbie Neilson.
Find all the latest football transfers on our dedicated page or visit our Premier League tracker here.
Cardiff City have loaned midfielder Stuart O'Keefe to League One side MK Dons until 1 May.