Self-healing hydrogels can adapt to the dynamic and mechanically demanding environment in the brain when compare to conventional brittle hydrogels. Herein, we developed a series of self-healing chitosan-dextran based hydrogels (CDgels) which were mechanically soft and its composition could be detected via CEST-MRI. Once crosslinked, CEST-MRI contrast at 1.2 ppm decreased when the crosslinking density increased. Interestingly, this phenomenon was observed when we further incorporated barbituric acid (BA) into CDgels to form part of the Schiff-base interaction. The resultant BA-loaded CDgels showed both CEST contrast at 3T, demonstrating a robust approach for imaging-guided hydrogel-based therapy in brain.