Functionalizing materials with biomacromolecules such as enzymes has broad applications in biotechnology and biomedicine. Here, we introduce a grafting method mediated by living cells to functionalize materials. We use polymeric scaffolds to trap engineered bacteria and micron-sized particles with chemical groups serving as active sites for grafting. The bacteria synthesize the desired protein for grafting and autonomously lyse to release it. The released functional moieties are locally grafted onto the active sites, generating the materials engineered by living grafting (MELGs). MELGs are resilient to perturbations because of both the bonding and the regeneration of functional domains synthesized by living cells. The programmability of the bacteria enables us to fabricate MELGs that can respond to external input, decompose a pollutant, reconstitute synthetic pathways for natural product synthesis, and purify mismatched DNA. Our work establishes a bacteria-assisted grafting strategy to functionalize materials with a broad range of biological activities in an integrated, flexible, and modular manner. A record of this paper's transparent peer review process is included in the supplemental information.