Catalysis of the reaction: meso-2,6-diaminopimelate + ATP + UDP-N-acetylmuramoyl-L-alanyl-D-glutamate = ADP + 2 H+ + phosphate + UDP-N-acetylmuramoyl-L-alanyl-D-gamma-glutamyl-meso-2,6-diaminoheptanedioate.
UDP-N-acetylmuramoyl-L-alanyl-D-glutamate:meso-2,6-diamino-heptanedioate ligase (ADP-forming) activity