I wrote this very small script about an year ago when I couldn't find any satisfactory plugins for xchat that'd display the current playing track in mpd.
I realized a few days back that this could as well be used as an interface to control mpd from xchat too.
Currently, this just displays the currently playing track without any exception handling as such.