In this work, a hypochlorous acid (HOCl)-responsive prodrug MB-R for diagnosis and therapy of ischemic stroke (IS) was constructed using the near-infrared fluorophore methylene blue linked to riluzole by the urea bond. MB-R exhibits good biocompatibility, fast response (<1 min), and high selectivity toward HOCl. MB-R was successfully utilized to visualize the HOCl levels, as well as the distribution of HOCl in the brains of IS mice to determine the progression of the disease. Meanwhile, the treatment with MB-R could reduce the cerebral infarction volume and improve the motor function in IS mice. Most importantly, MB-R could be utilized in the treatment of stroke through antioxidant, anti-inflammatory, and neuroprotective effects, further suggesting that riluzole was a potentially therapeutic agent for IS. Thus, this work paves the way for the development of intelligent theranostic agent for the early diagnosis and treatment of IS.