  We discuss the gluing construction of class $\mathcal{S}$ chiral algebras in
derived setting. The gluing construction in non-derived setting was introduced
by Arakawa to construct a family of vertex algebras of which the associated
varieties give genus zero Moore-Tachikawa symplectic varieties. Motivated by
the higher genus case, we introduce a dg vertex algebra version
$\mathsf{MT}_{\mathrm{ch}}$ of the category of Moore-Tachikawa symplectic
varieties, where a morphism is given by a dg vertex algebra equipped with
action of the universal affine vertex algebra, and composition of morphisms is
given by the BRST reduction. We also show that the procedure taking the
associated scheme of gives a functor from $\mathsf{MT}_{\mathrm{ch}}$ to the
category $\mathsf{MT}$ of derived Moore-Tachikawa varieties, which would imply
compatibility of gluing constructions in both categories.
