A device is provided for repairing erosion damage to a bore of a railgun with metal powder. The bore has a surface contour that extends longitudinally of the railgun. The device includes a housing, a profilometer sensor and a nozzle. The housing has a configuration that conforms to the surface contour and an upstream face on a longitudinal end. The profilometer sensor mounts to the upstream face to measure depth of the erosion and indicate a divot in the bore that involves repair to match the surface contour. The nozzle mounts to the upstream face to spray the metal powder from a reservoir within the housing in response to the divot indicated by the profilometer.