Neural electrodes have been widely used to monitor neural signals and/or deliver electrical stimulation in the brain. Currently, biodegradable and biocompatible materials have been actively investigated to create temporary electrodes that could degrade after serving their functions for neural recording and stimulation from days to months. The new class of biodegradable electrodes eliminate the necessity of secondary surgery for electrode removal. In this study, we created biodegradable, biocompatible, and implantable magnesium (Mg)-based microelectrodes for in vivo neural recording for the first time. Specifically, conductive poly-3,4-ethylenedioxythiophene (PEDOT) was first deposited onto Mg microwire substrates by electrochemical deposition, and a biodegradable insulating polymer was subsequently sprayed onto the surface of electrodes. The tip of electrodes was designed to be conductive for neural recording and stimulation, while the rest of electrodes was insulated with a polymer that is biocompatible with neural tissue. The impedance of Mg-based microelectrodes and their performance during neural recording in the auditory cortex of a mouse were studied. The results first demonstrated the capability of Mg-based microelectrodes for in vivo recording of multi-unit stimulus-evoked activity in the brain.