McGain, who was poised to make his Test debut at the age of 36, suffered tendon damage while bowling in India and was forced to return home early.
McGain initially injured the area underneath his right shoulder during an Australia A match in India last month and further aggravated it while preparing for a tour match with the senior Australian squad.
"No-one likes to be sidelined and this injury under my armpit has come at a particularly bad time," McGain said in a statement.
"Hopefully the fitness work I've done during the pre-season will stand me in good stead in terms of my recovery and allow me to get stuck into my rehab and back in the nets as soon as possible.
"This is a setback, but I've bounced back from a few of these before and am confident this treatment will allow me to return as strong as ever."
Medical staff said McGain's recovery time will depend on his progress following the surgery.
Australian cricket is struggling to throw up a quality spinner following the retirements of legendary Shane Warne and fellow wrist spinner Stuart McGill in quick succession over the last two years.