Heathrow is in his Hayes and Harlington constituency, which is strongly opposed to the proposed third runway.
District Judge Deborah Wright said: "It (his witness statement) gives an opinion about the debate around the expansion of Heathrow and talks about the benefits of direct action, which he says may cause short term inconvenience.
"In order to allow his evidence to be given I have to be able to say that it is relevant.
"I am therefore not going to allow Mr McDonnell to give live evidence."
Sian Berry, the Green party London mayoral candidate, has also been told her evidence is inadmissible.
The activists are on trial at Willesden Magistrates Court charged with aggravated trespass and entering a security restricted area of an aerodrome.
Their protest came after a long-awaited report recommended that a new runway should be built at Heathrow rather than Gatwick.
The protesters say they felt they had a duty to warn that building a new runway there will make it harder to reduce air pollution and climate change emissions.
Mr McDonnell said in his statement, which was later released online: "Although the specific direct action can at times cause some short term inconvenience, by highlighting a threat like climate change, it can have a longer term and more significant effect on averting the impact of a greater risk."
He added: "Given the urgency of the environmental problems Heathrow is causing, and the deeply disappointing lack of commitment shown by Heathrow and the Government to unequivocal promises they have both made, it's almost inevitable that activists will lose patience with a process that they no longer trust and do what they can to solve the problems themselves."
As the trail began, Kara Moses, one of the campaigners and an environmental journalist, revealed they had all been wearing nappies during the protest.
She said the group planned to block the runway all day and stop "hundreds" of planes from taking off.
Ms Wright asked: "If you thought you were going to be there all day, how were you going to address basic needs such as going to the toilet?"
Ms Moses replied: "We were wearing nappies, madam."

Source: http://telegraph.feedsportal.com/c/32726/f/579309/s/4d0028c9/sc/13/l/0L0Stelegraph0O0Cnews0Cpolitics0Clabour0C12110A8970CJohn0EMcDonnell0Ebarred0Efrom0Egiving0Eirrelevant0Eevidence0Eat0EHeathrow0Eprotest0Etrial0Bhtml/story01.htm