I've been using SCMPC to scrobble my music played with MPD to Last.fm for a couple of years now. I can't find a package for it in the repositories, but it's easy to install from source. The source hasn't changed in almost 3 years, but it still seems to be working fine.

EDIT: After running the setup described herein for several days, I've uninstalled PulseAudio and use ALSA instead. While PulseAudio may be a theoretically better system, its implementation in 9.10 is perfectly awful. Not only was MPD/MPC constantly crashing, but sometimes I'd lose sound system-wide. Also once Pulse is gone, you can roll back to Adobe Flash 9 (with sound!), which is infinitely better on my machine than 9.10's implementation of Flash 10.

The installation wasn't as straight-forward as I'd hoped, so maybe these notes will help others. This is specifically for Ubuntu 9.10 Karmic Koala (I'm running the 32 bit / i386 desktop edition), running the default pulse audio.

Update your MPD database. The new version of MPD has changed some things about the "mpd --update-db" command, so you should use:
mpc update

At this point I could play music, I just couldn't change the volume. I got the following error:
error: ACK [52@0] {setvol} problems setting volume

The problem was that MPD was trying to use ALSA instead of pulse audio. Edit the MPD configuration file to enable pulse audio. Find the Audio Output section of the file and add or un-comment the following lines:
audio_output {
type "pulse"
name "My MPD PulseAudio Output"
}