Thanks to the precise control over their structural and functional properties, genetically engineered protein-based hydrogels have emerged as a promising candidate for biomedical applications. Given the growing demand for creating stimuli-responsive "smart" hydrogels, here we show the synthesis of entirely protein-based photoresponsive hydrogels by covalently polymerizing the adenosylcobalamin (AdoB 12 )-dependent photoreceptor C-terminal adenosylcobalamin binding domain (CarH C ) proteins using genetically encoded SpyTagSpyCatcher chemistry under mild physiological conditions. The resulting hydrogel composed of physically self-assembled CarH C polymers exhibited a rapid gel-sol transition on light exposure, which enabled the facile release/recovery of 3T3 fibroblasts and human mesenchymal stem cells (hMSCs) from 3D cultures while maintaining their viability. A covalently cross-linked CarH C hydrogel was also designed to encapsulate and release bulky globular proteins, such as mCherry, in a light-dependent manner. The direct assembly of stimuli-responsive proteins into hydrogels represents a versatile strategy for designing dynamically tunable materials.hydrogels | cell encapsulation | drug delivery | photoresponsive materials | protein engineering