Engineering an elaborate nanotheranostic platform that can achieve spatiotemporally selective microRNA (miRNA) imaging and imaging-guided therapy in time is critical for precise cancer diagnosis and efficient treatment, yet remains a challenge. Herein, we present an on-site-activatable nanotheranostic platform (Ti3C2-NEDR) that engineers a photothermal-activated entropy-driven strand displacement reaction (NEDR) module on a photothermal conversion module (Ti3C2) for achieving spatiotemporally controlled miRNA-21 imaging in vivo and imaging-guided photothermal therapy only by varying the power of the near-infrared (NIR) laser. The upstream NIR photothermal conversion module, Ti3C2, can act not only as a DNA circuit carrier to deliver the NEDR module but also as a photothermal agent to activate the downstream NEDR module in low-power NIR laser irradiation. Once the NEDR module is activated by the NIR laser, the entropy-driven strand displacement reaction can be innated by intracellular miRNA-21 to generate an amplified fluorescence signal for the spatiotemporally selective imaging of miRNA-21 in vivo. Thereafter, the imaging-guided in vivo photothermal therapy can be achieved in time only by switching to the high-power NIR laser. It is envisioned that this strategy of NIR light-activated spatiotemporally selective miRNA imaging and imaging-guided on-demand therapy may expand the nanotheranostic platform for precise cancer diagnosis and personalized therapy in time, providing a remarkable prospect in biomedical diagnosis and therapy.