In situ monitoring microRNA (miRNA) expression in vivo holds immense potential for directly visualizing the occurrence and progression of tumors. However, the significant barrier to developing a probe that can overcome the low abundance of miRNAs while providing an output signal with unlimited tissue penetration depth remains formidable. In this study, we developed a DNA machine-based magnetic resonance imaging nanoprobe (MRINP) for amplified detection of miR-21 in vivo. The MRINP was constructed with superparamagnetic Fe3O4 nanoparticles (NPs), paramagnetic Gd-DOTA complexes, and miR-21-activated DNA machines; the DNA machine was composed of hairpin DNAzyme (HD) strands serving as the DNAzyme walker and hairpin substrate (HS) strands serving as the track. Once uptake into tumor cells, the intracellular miR-21 specifically recognized and hybridized with the HD strand, restoring the activity of DNAzyme. Subsequently, the DNAzyme walker autonomously traveled on the surface of MRINP, and each step movement of the DNAzyme walker resulted in the cleavage of its substrate strands and the ensued release of the Gd-DOTA complex-labeled oligonucleotides, turning on the T1 signal of Gd-DOTA complexes for in situ imaging of miR-21 in tumor-bearing mice. This strategy would offer a promising approach for mapping tumor-specific biomarkers in vivo with unlimited penetration depth.