Robert Ashman, 49, appeared at a committal hearing before magistrates at Cheltenham, Gloucestershire.
The court was told how MP Nigel Jones was convinced that Mr Ashman tried to murder him and twisted the sword in an effort to worsen the injuries.
Mr Ashman, of Lansdown Place, Cheltenham, is charged with murdering Andrew Pennington and attempting to murder Mr Jones at the Liberal Democrat constituency office in the town on 28 January.
Reporting restrictions were lifted at the request of the defence.
Dennis Scully, prosecuting, said that before the attack Mr Ashman had visited his parents' house in Cheltenham, where he read the book Gray's Anatomy. On leaving he picked up a Samurai sword without them knowing.
Later that afternoon, Mr Ashman arrived at Mr Jones's constituency office, where Andrew Pennington invited him into the interview room.
There, Mr Jones, Mr Pennington and Mr Ashman discussed a continuing legal row he was having over the repossession of his former home, according to the prosecution.
He described how Mr Jones and Mr Pennington appealed for calm but Mr Ashman then opened his coat, drew the sword and told the MP: "I'll tell you what I am going to do."
He allegedly struck at Mr Jones, who deflected a blow from the sword and managed to escape.
The MP suffered severe lacerations to his hands after grabbing hold of the blade.
Mr Pennington was found suffering from multiple fatal stab wounds to chest and back.
Mr Ashman's lawyer, Roger Everest, had argued that the murder charge involving Mr Pennington should be dropped because no one saw his client attacking him.
The defendant has been remanded in custody until the hearing next month.