A punctal plug or lacrimal insert comprising a microelectromechanical system pump and associated reservoir may be utilized to deliver precise dosages of an active agent into the eye though the tear film. The microelectromechanical system pump comprises four main components namely, a reservoir, a pump, a series of valves and a vent. The microelectromechanical system pump is positioned within a cavity in the punctal plug. The microelectromechanical system pump is positioned with a cavity in the punctal plug.