Can I claim refinance costs that are then rolled into the mortgage?

I.e. for a zero-closing cost lender. The costs still exist, but they are rolled into the mortgage instead of paying them outright at closing.