He played in Saturday's derby defeat to the Scarlets and has played in eight GUINNESS PRO12 matches for the Welsh region this season.
The 33-year-old was also part of the Wales squad that finished second in the RBS 6 Nations, coming off the bench in the game against England.
However after the Scarlets clash, it was discovered that he had an eye issue and would need treatment.
"As part of Paul's routine post-match medical check on Saturday, the doctor identified an eye problem and referred him to a specialist for consultation," Ospreys medical performance manager Chris Towers said.
"His advice was that surgery was required to prevent the issue worsening.
"Paul had an operation on Thursday. We will continue to consult with the specialist, and are still awaiting further details of his after-care."
It is not yet clear how long James will be absent.
To buy tickets for the GUINNESS PRO12 Grand Final click here. Also follow us on Facebook, join the conversation on Twitter, sign up to our YouTube channel for extensive match highlights and sign up for our newsletter for regular updates on the GUINNESS PRO12.