Manager Duncan Russell told the club website: "It was spoken about by Rhys and my predecessor [David Holdsworth].
"I noticed after certain games he couldn't train the next day and he was still struggling with it."
Russell added: "A scan showed he has scarring on his patella tendon so he's going into hospital next week for a procedure.
"It's in the interests of the club to get Rhys in, operated on and rehabilitated for next season."
The former Wales Under-21 international has made nine appearances for the Stags this season, having previously played for them from 2003-2006.
Source: BBC Sport
Source: BBC Sport