Wg-quick from the same project as Wireguard supports pre/post-up/down Hooks. You should be able to very easily write a post-up hook that read the rules from the server and a pre-down one that delete them.
Since your are connected to the server using Wireguard, you don't need to check its identity you can just open the correct port, read the rules and apply them, a simple Python or Perl script should be able to do what you want.