Is it possible to run a command (like “code ./foldername) on my ssh connection and have that command do something on the host (e.g. open vscode)?

When I ssh into my remote server and want to open something in vscode, I cannot do so from the command line. Obviously that makes sense because the code command runs on the remote server which has no idea about the host.

When running code from a vscode integrated terminal using the ssh plugin will however open another vscode window for that remote folder.

It would be great if I could find a way to launch vscode from a normal terminal window over ssh. Does such a thing exist?