The biggest problem is giving each client Mac 'root' access to the server. And giving root access can be a security problem, so I hope you trust anyone with access to those client systems.
The script itself could be as simple as an Applications -> Automator app that using the "Run Shell Script" action with the ssh command:
ssh root@servers.address shutdown -h now
But to give each client root access requires each users on each client Mac generate a no password ssh-keygen public/private key pair. Then copy the /Users/username/.ssh/*.pub file to the server, and store that contents of each *.pub file in the server's /private/var/root/.ssh/authorized_keys2 file.
Another approach might be to create a server side /etc/sudoers entry that (see man sudoers) that allows a special shutdown account (that you create on the server) the right to shutdown the system. Then instead of putting the *.pub files in the server's root .ssh/authorized_keys2 file, you would put the *.pub files in the special shutdown account's .ssh/authorized_keys2 file. That way the worse that would happen if an unauthorized user got access to one of those Mac clients would be that they could shutdown the server, which while annoying, would not allow them full unlimited access to the server.
The devil of course is in the details 🙂