Maximization of phototoxic damage on tumor with minimized side effect on normal tissue is essential for effective anticancer photodynamic therapy (PDT). This requires highly cancer-cell-specific or even cancer-cell-organelle-specific synthesis or delivery of efficient photosensitizers (PSs) in vitro and in vivo, which is difficult to achieve. Herein, we report a strategy of cancer-cell-activated PS synthesis, by which an efficient mitochondria-targeting photosensitizer with aggregation-induced-emission (AIE) feature can be selectively synthesized as an efficient image-guided PDT agent inside cancer cells. MOF-199, a CuII -based metal-organic framework, was selected as an inert carrier to load the PS precursors for efficient delivery and served as a CuI catalyst source for in situ click reaction to form PSs exclusively in cancer cells. The in situ synthesized PS showed mitochondria-targeting capability, allowing potent cancer-cell-specific ablation under light irradiation. The high specificity of PSs produced in cancer cells also makes it safer post-treatment.