I want to know is it possible to generate master public key from an address? if not, what is needed to generate xpub key?
It's not possible. An address is created though a hash160 (RIPEMD160) which is a one-way function.
Creating a xpub key (bip32 extended public key) requires the according pubkey and the
Alternatively you can calculate an xpub from an xpriv (extended private key).