You could probably use ESPHome or Tasmota serial port proxy for this ... Just connect to it using nc
or something like that.
https://esphome.io/components/uart.html#debugging
https://github.com/thegroove/esphome-serial-server
https://tasmota.github.io/docs/Serial-to-TCP-Bridge/
Using ESPHome is probably the fastest path to something that works since you can use the serial server and/or debug mode to figure out the commands you want to read/write and write a config for those right away.