The 22-year-old becomes the latest new arrival at the Kilmac Stadium at Dens Park after Josh Todd (Queen of the South) and Declan McDaid (Ayr United).
McGhee had a spell on loan at Middlesbrough during his time at Tynecastle and was a regular for the Scotland U21 side.