You can just connect to a running X session from an SSH shell; if your X server is on display :0 (usually the default), then you just

  export DISPLAY=:0
  echo foo | xclip -selection clipboard
This even can work with Wayland, where it becomes

  export WAYLAND_DISPLAY=wayland-1
  echo foo | wl-copy
(Note that AFAICT Wayland sessions number from 1 instead of 0)