A metal-organic framework stabilizes an occluded photocatalyst.