Sir David, MP for Southend West, died during a constituency surgery in Leigh-on-Sea, Essex, on 15 October.
Ali Harbi Ali denies Sir David’s murder and preparing acts of terrorism and is currently on trial at the Old Bailey.
The court heard Mr Ali booked an appointment with Sir David and had travelled from London to see him.
After fatally attacking Sir David, the defendant then threatened to kill four other people, the court was told.
The jury heard a 999 call from Yvonne Eaves who, with her partner Darren King, was due to have the next appointment with Sir David.
She told the operator that the attacker had killed Sir David and was threatening to kill them and two of the MP’s female staff at the church.
In the call, she said: “Please, please, quick. Now the man is wielding a knife, he’s threatened me… He’s killed David Amess at Belfairs Methodist Church.”
Ms Eaves appeared to call out to her partner to “come away”, adding: “It’s horrible, it’s horrible.”
She described the weapon as a “big kitchen carving knife” about 12in (30cm) long.
“We tried to get it off him. He won’t. He’s threatened myself, he’s threatened four people here.
She said Mr Ali had said he “wants to get shot”.
The court was told how before Sir David’s death, Mr Ali exchanged a series of emails with the MP’s office in which he claimed to be moving to the area.
Tom Little QC, prosecuting, told how Mr Ali had feigned an interest in churches and healthcare to get a meeting with the Southend MP.
On Tuesday, Mr Little took the jury through a timeline of events leading up to the 69-year-old’s death.
He said Mr Ali searched for information about Sir David on 22 July last year and three hours later he was near the Houses of Parliament.
Mr Ali had also researched cabinet minister Michael Gove, MP for Finchley and Golders Green in London, Mike Freer and Labour Leader Kier Starmer in September, jurors heard.
Mr Little said Mr Ali emailed Sir David’s office on 27 September asking for an appointment claiming to be interested in Christianity.
The defendant, Mr Little said, wrote: “I will be moving to the area from a Labour-held constituency and wanted to get to know my future MP.
“Since I work in healthcare, I would like to know his plans, if any, for the hospital and workers.
“Also, as someone interested in Christianity, I have seen many churches in my area losing attendances and struggle with upkeep, eventually becoming at risk of being demolished or repurposed.
“I wanted to know if the situation in Southend is similar and, if so, what are the solutions.”
He added: “Looking forward to seeing you soon. If all appointments are taken, let me know if there’s a cancellation. I’ll be in the local area and will be able to drop by.”
An aide replied and asked him to confirm his full name and address to check he was a constituent.
The defendant provided a postcode in Southend and was told all appointments had been taken and was offered one on 15 October.
Mr Ali replied to say his “schedule is rather hectic for the next couple of weeks so I’m not sure I’ll be available”, the court heard.
However, on 30 September, he replied to say he was “able to clear up my schedule” and asked for an appointment at noon.
He told aide Rebecca Hayton: “I don’t really know how long the appointments are but I don’t think I’ll take too long. Thanks for all the help so far.”
The jury was shown CCTV footage of Mr Ali travelling from his home in Kentish Town to Leigh on Sea. He was wearing a long khaki jacket with a black backpack over his right shoulder, blue trainers and black trousers.
Around the time of the attack on Sir David, Mr Ali sent a message to family and friends which appeared to have been drafted days before, the court was told.
In it, he said the attack was “for the sake of Allah”, jurors heard.
He allegedly wrote: “I apologise to my family for deceiving them for so long. I would have preferred Hijrah so as not to harm you but I could not
“The obligations upon me to take revenge for the blood of Muslims were too great.
“The shame of abiding in the very lands that carry out these horrendous acts against my brothers and sisters was too much.”
The court heard he spent 14 minutes on the phone to his sister, aborting the call when he was confronted and arrested.
The trial continues.