Closing costs can be added to the mortgage loan however be aware that when you do add closing costs to your mortgage that the interest rate on your mortgage may go up so you'll end up paying more in interest on your mortgage.
When paying closing costs it's best to pay cash for the closing costs out of your own pocket instead of adding it to the mortgage.