Streptomyces mobaraenesis transglutaminase (smTG) can be used for site-specific labeling of proteins with chemical groups. Here, we explored the use of modified smTG for the biosynthesis of nanobody-fluorophore conjugates (NFC). smTG catalyzes the conjugation of acyl donors containing glutamine with lysine-containing acceptors, which can lead to non-specific cross-linking. To achieve precise site-specific labeling, we employed molecular docking and virtual mutagenesis to redesign the enzyme's substrate specificity towards the peptide GGGGQR, a non-preferred acyl donor for smTG. Starting with a thermostable and highly active smTG variant (TGm2), we identified that single mutations G250H and Y278E significantly enhanced activity against GGGGQR, increasing it by 41 % and 1.13-fold, respectively. Notably, the Y278E mutation dramatically shifted the enzyme's substrate preference, with the activity ratio against GGGGQR versus the standard substrate CBZ-Gln-Gly rising from 0.05 to 0.93. In case studies, we used nanobodies 1C12 and 7D12 as labeling targets, catalyzing their conjugation with a synthetic fluorophore via smTG variants. Nanobodies fused with GGGGQR were successfully site-specifically labeled by TGm2-Y278E, in contrast to non-specific labeling observed with other variants. These results suggest that engineering smTG for site-specific labeling is a promising approach for the biosynthesis of antibody-drug conjugates.