The documentation for the Electrum Server Protocol is the same as for ElectrumX, i.e. this one: https://electrumx-spesmilo.readthedocs.io/en/latest/protocol.html
Electrs most probably also follows that.
https://learnmeabitcoin.com/technical/images/extended-keys/child-extended-public-key-normal.png
That being said, existing solutions can be found easily on GitHub. This one for example, seems to fit almost exactly your description; since it's in JavaScript it should be easy to embed it in a NodeJS application with API that you add yourself. https://github.com/swan-bitcoin/xpub-tool