I autoclaved a 1% methylene blue solution for counter staining and noted no color change or precipitation. Agar preparations containing the dye, such as Eosin Methylene Blue (EMB), indicate autoclaving as a required step (https://www.fda.gov/food/laboratory-methods-food/bam-media-m80-levines-eosin-methylene-blue-l-emb-agar). Most dyes are difficult to sterile filter, therefore if you are worried about autoclaving I suggest stirring the dye powder into sterile distilled water under mild heat and adding to molten agar prepared less the volume of water you use to dissolve the dye. I hope this helps.