Your private keys stay on the Mac, or on your YubiKey, and gpg on the Linux host uses them over SSH.
Last tested in October 2026 from macOS with GnuPG 2.5.24 and OpenSSH 10.5 to Debian 13 with GnuPG 2.4.7 and OpenSSH 10.0. You need GnuPG 2.1.17 or newer on both ends and OpenSSH 6.7 or newer.
Install GnuPG and a graphical pinentry. Passphrase and PIN prompts appear on the Mac, so a terminal pinentry won't work for a request that comes from the remote host.