I already have an ssh agent set up, and I can run commands on an external server in Bash script doing stuff like:
ssh blah_server "ls; pwd;"
Put all the commands on to a script and it can be run like
ssh @ "bash -s" <./remote-commands.sh