Hello and welcome.
There could be several things causing that issue:
-Bad Lightning-to-USB cable
-Foreign material in the Lightning port on the iPhone
-Issue with the port(s) on the MBP
Suggestions:
-Check the Lightning port on the phone, and gently clean out any lint/debris
-Try another Lightning-to-USB cable
-Does the issue occur when simply charging the iPhone with the AC brick?
C