What is the metal part on top of this connector?
Yes, that cap is intended to allow a pick &amp; place machine at the assembly house to pick up the connector and place it on the PCB. Depending on the connector and the manufacturer, they can come in metal, plastic, or film ("sticker") types. Here is an example from GCT (Global Connector Technology):

http://gct.co/pcb-board-to-board/pcb-connector-packaging/

Attribution for picture : GCT