This protocol describes an imaging-based method to activate T lymphocytes using photoactivatable peptide-MHC, enabling precise spatiotemporal control of T cell activation.