launchd socket input
You're almost there. Wrap your first script in a while loop and you are set:

#!/bin/sh

while true; do
    read MSG
    echo $MSG
done


This is necessary to keep the process alive. Without the loop the script exits after the first line of input.

The exec approach works because you replace the current shell with /bin/cat. It is the same as calling /bin/cat directly.