Quantum key agreement (QKA) permits participants to constitute a shared key on a quantum channel, while no participants can independently determine the shared key. However, existing Measurement-device-independent (MDI) protocols cannot resist channel noise, and noise-resistant QKA protocols cannot resist side-channel attacks caused by equipment defects. In this paper, we design a MDI-QKA protocol against collective-dephasing noise based on GHZ states. First, in our protocol, Alice and Bob prepare a certain number of GHZ states respectively, and then send two particles of each GHZ state to Charlie for bell measurement. Results are that Alice and Bob can obtain Bell states through entanglement exchange with the help of dishonest Charlie. Meanwhile ensures the transmission process noise-resisted. Then, Alice and Bob encode their key components to the particle in their hands and construct logical quantum states against collective noise through additional particles and CNOT operation to implement MDI-QKA. Compared with existing MDI-QKA protocols, our protocol uses logical quantum states during particle transfers, which makes the protocol immune to collective-dephasing noise, and therefore improving the final key rate. Security analysis shows that our protocol can resist common insider and outsider attacks.