Do I need to get a permit to replace my boiler?

Yes.  Replacement is one of the actions listed as requiring a permit (IMC 106.1) and replacing a piece of equipment (boiler, furnace, condenser unit, HRV, etc.) is not a "minor part" so not included in the list of exceptions to this requirement (IMC 106.2)