Bilal Zaheer Ahmad, 23, from Wolverhampton, was also sentenced for other terrorism offences.
Prosecutors at Bristol Crown Court said Ahmad had used a website called revolutionmuslim.com to encourage others to attack MPs.
The website has since been closed down by the authorities in the US.
Sentencing Ahmad, the judge, Mr Justice Royce, described him as a "viper in our midst" and said he was "willing to go as far as possible to strike at the heart of our system".
The judge told him: "Whatever our views on the Iraq War, we are a democracy.
"You purport to be a British citizen, but what you stand for is totally alien to what we stand for in our country."
Ahmad, an IT graduate from Dunstall Hill who holds both British and Pakistani passports, pleaded guilty to using the website to encourage the murder of MPs who he claimed had supported the 2003 invasion.
Surgery meetingIn his web posting on the Islamic extremist website, he advised readers on the site's message board how to find out constituency surgery details and provided a link to an online shopping site selling knives.
He also had in his possession electronic copies of books called '39 ways to serve and participate in jihad' and 'Zaad-e-Mujahid: Essential provisions of a mujahadid'.
His messages came a day after the conviction of a Muslim woman, Roshonara Choudhry, for the attempted murder of Labour MP Stephen Timms.
Choudhry stabbed Mr Timms, the Labour member for East Ham, in the stomach at a surgery meeting. Ahmad praised her attack and said it should inspire others to follow suit.
The day before Choudhry was sentenced, Ahmad posted on Facebook: "This sister has put us men to shame. We should be doing this."
Two days later, he posted on the Metro newspaper website: "I think Timms got let off lightly, in comparison to the countless civilians that have been killed as a direct result of the war he voted for.
"Roshonara Choudhry is a heroine. Free Roshonara Choudhry and give her a medal for justice."
'Ironic gesture'When he was arrested, Ahmad told officers: "I shouldn't have let my emotions get away from me. It was completely irrational. It was tongue-in-cheek, I'm not in a cell or anything like that."
Continue reading the main storyIt was wrong, it was perverted and he now absolves himself from it completely. He was a follower and not a leader”End Quote Imran Khan Ahmad's defence lawyer Prosecutor Mark Dennis QC said: "He claimed that the posting of the entry had in effect been a spur of the moment act, done partly as an emotional response to recent events, partly out of 'insolence' and partly as an 'ironic gesture'."
The court heard that Ahmad first became radicalised as a teenager and was an active contributor to several extremist websites.
Imran Khan, defending, said Ahmad had fallen in with members of Islamist movement al-Muhajiroun when aged 16 at college because he felt excluded from mainstream society.
He said Ahmad's growing interest in Islam had been at odds with the non-religious upbringing of his parents.
"This is not the case of a man indoctrinating but of a man who has been indoctrinated by others," Mr Khan said.
"It was wrong, it was perverted and he now absolves himself from it completely. He was a follower and not a leader."
'Track offenders down'The head of West Midlands Counter Terrorism Unit, Det Ch Supt Kenny Bell, said it was a "challenging investigation" because Ahmad was posting on foreign-based websites, and international cooperation was key in securing the conviction.
"Online extremism is an area of counter terrorism policing that we are increasingly focussed on.
"We need to protect vulnerable individuals from being urged to commit serious crimes by extremists and radicalisers who are exploiting the internet. We can and will track offenders down."
As well as being jailed for 12 years, Ahmad was ordered to serve an additional five years' extended period on licence.
The other terror offences included one for intent to stir up religious hatred and three counts of collecting information likely to be of use to a terrorist.