There are plenty of opto isolators out there that will do this for you.
Just be sure to use a big enough resistor to limit the current and make sure it is flame-proof... I can't recall getting any other direction on that.
Also, check the isolation voltage of the opto, but it should be good enough, they're usually pretty high.
I don't recall the specific ones that I used, but I can check tonight if you need some specific part numbers.
The ones I chose have dual (reverse biased) LEDs, so that it picks up both halves of the cycle.