Microglia, the resident immune cells of the brain, respond quickly with morphological changes to modifications of their environment. This protocol describes how to use two-photon microscopy to study the attraction of microglial processes toward serotonin or ATP in acute brain slices of mice.