The present disclosure relates to a thrombin-responsive closed-loop patch for prolonged heparin delivery in a feedback-controlled manner. The microneedle-based patch can sense the activated thrombin and subsequently release heparin to prevent coagulation in the blood flow. The patch can be transcutaneously inserted into skin without drug leaking and can sustainably regulate blood coagulation in response to thrombin.