A sensitive electrochemical sensor is designed for DNA detection based on mimetic catalysis of metal-organic framework (MOF) and allosteric switch of hairpin DNA. The functional MOFs are synthesized as signal probes by a one-pot encapsulation of iron(III) meso-5,10,15,20-tetrakis(4-carboxyphenyl) porphyrin chloride (FeTCPP) into a prototypal MOF, HKUST-1(Cu), and sequentially conjugated with streptavidin (SA) as a recognition element. The resulting FeTCPP@MOF composites can mimetically catalyze the oxidation of o-phenylenediamine (o-PD) to 2,2'-diaminoazobenzene, which is a good electrochemical indicator for signal readout. The presence of target DNA introduces the allosteric switch of hairpin DNA to form SA aptamer, and thus, FeTCPP@MOF-SA probe is brought on the electrode surface via the specific recognition between SA and the corresponding aptamer, resulting in the enhancement of electrochemical signal. The "signal-on" electrochemical sensor can detect target DNA down to 0.48 fM with the linear range of 10 fM to 10 nM. Moreover, the MOF-based electrochemical sensor exhibits acceptable selectivity against even a single mismatched DNA and good feasibility in complex serum matrixes. This strategy opens up a new direction of porphyrin-functionalized MOF for signal transduction in electrochemical biosensing.