The macbook(uni or pro) are made out of aluminum (electric conductor) and they build electrostatic charge overtime (and they are not grounded since the power brick only have 2 contacts)
The easiest way to avoid it is by always wearing isolating cloth, if you really want to get rid of it no matter what, then you should try get something to "ground" it, a large conductor will do (e.g. put your computer on an aluminum table, by the way the conductor have to make contact with the computer, you can also stick a piece of wire to one corner of the laptop, again making sure it does contact, and sticking the other side of the wire to a large conductor, other thing you can do, is getting one of those cool pads that are made out of aluminum and if its "heavy enough" it will work fine + it will ground it, but again I have experienced the shock as is not that bad so you can just get use to it anyway it should not damage your computer nor kill you...