Two politicians have launched a legal action to challenge the government's ability to spy on parliamentarians.

The pair allege that GCHQ is violating a long-established rule that bans intelligence agencies from eavesdropping on MPs and peers. They say their communications are likely to have been intercepted by GCHQ, which gathers and stores data on millions of people "on a blanket basis".

The claim by Caroline Lucas, MP for Brighton Pavilion, and Lady Jones of Moulsecoomb, the Green party's two representatives in parliament, adds to a growing number of legal challenges over the large-scale harvesting of emails, phone calls and other internet traffic by GCHQ.

Their complaint focuses on a rule introduced by 1966 by the then prime minister, Harold Wilson, instructing Britain's intelligence agencies not to tap the telephones of MPs and peers unless there is a national emergency.

A government minister acknowledged last July that this explicit ban, still in force and known as the Wilson doctrine, also applied to electronic surveillance.

Lucas and Jones say: "The Wilson doctrine is a fundamental doctrine of public policy. It not only protects the rights and privileges of elected politicians, but it also protects the privacy of their communications with their constituents, who may very well be complaining or whistleblowing about the very government departments and agencies and other agents of the state who try to carry out surveillance on them."

They say there is a strong likelihood that GCHQ spies "have intercepted and are intercepting [their] communications as members of the Houses of Parliament".

They highlight a secret GCHQ programme codenamed Tempora, whose existence was disclosed by the Guardian last June. Confidential documents leaked by Edward Snowden revealed that GCHQ had secretly gained access to the network of fibre-optic cables that carries the world's phone calls and internet traffic.

The spy centre has been scooping up huge quantities of communications between innocent people as well as targeted suspects, according to the documents. The sensitive information, shared with the NSA, included recordings of phone calls, the content of email messages, and entries on Facebook.

Lucas and Jones say the Tempora programme is unlawful as they had a "legitimate expectation" that their communications were protected under the Wilson doctrine.

With the help of the human rights law firm Leigh Day, they have lodged a claim with the investigatory powers tribunal, the secretive court that hears complaints about Britain's intelligence agencies. They want a declaration that the interception of their communications has been prohibited.

Lucas said: "I am deeply concerned that GCHQ may have spied on members of parliament. Every day, MPs deal with very personal issues that their constituents raise with them. By spying on MPs, GCHQ has been spying on us all, as everyone may at some time need the help of their MP.

"There are good reasons why GCHQ are prohibited from spying on MPs – this matter goes to the heart of our democracy. If people cannot trust that their conversations with their MP are private, then important issues will not be raised in parliament and receive the scrutiny that they deserve."

GCHQ says it has a longstanding policy of never commenting on intelligence matters, but insists that all of its activities are necessary, proportionate and in accordance with UK law, governed by rigorous oversight.

Other complaints about the spy centre's mass surveillance have been initiated by pressure groups including Privacy International and Liberty.