Electrum doesn't share the extended public key aka master public key with electrum servers. It asks for relevant transaction data by sharing
your addresses script hashes relevant to your wallet [1] with the server. The distinction is important because exposure of the MPK is bad for your security and the MPK tells you all the addresses that can ever be generated in your wallet even ones that you haven't actually generated yet.
[1] Edit: I just learned on IRC that Electrum no longer shares the address with the server. Instead it subscribes to transactions relevant to the output script aka scriptpubkey:
https://electrumx.readthedocs.io/en/latest/protocol-basics.html#script-hashesOf course if the server operator wants to he can find out the address from this but it's one extra step he has to take.