A man accused of plotting to behead conservative blogger Pamela Geller has denied wanting to hurt anyone, claiming he had been living in a "fantasy" world.

David Wright, from Massachusetts, US, admitted sharing Islamic State (Isis) propaganda online and discussing an attack against Geller.

But he rejected accusations he supported the terror group and insisted his conversations about violence were just "trash talk" fueled by a desperate desire for attention.

"I said a lot of fantastical things about what I intended, where I wanted to go and where I wanted to travel, and it was never real – it was fantasy," he said when he took to the stand during his trial at Boston's federal courthouse.

The 28-year-old is charged with obstruction of justice, conspiring to provide material support to a designated foreign terrorist organisation and conspiring to commit acts of terrorism transcending national boundaries. He could face life in prison if convicted.

Prosecutors say Wright, his uncle and a third man agreed to kill Geller after she planned a prophet Muhammad cartoon contest in Texas in 2015.

During the contest, two other men opened fire outside and wounded a security guard before they were killed in a shootout with law enforcement assigned to guard the event. The beheading plot against Geller was never carried out.

Days later, Wright's uncle, Ussamah Rahim, told Wright in a phone call that he couldn't wait to attack Geller and decided instead to go after "those boys in blue". Hours later, Rahim was approached by officers in a Boston parking lot and fatally shot after he pulled out a knife and moved toward them, officials say.

Wright acknowledged telling his uncle that it was a "beautiful moment" when he heard of his plan to attack police. He also admitted to wiping the documents from his computer, transferring all of his Islamic State materials to a thumb drive after learning his uncle had been killed.

But he said he didn't believe his uncle was serious about the attack on police and broke down in tears on the stand as he discussed his death.

"I lost someone who was very close to me because I was so deluded and self-centered that I couldn't see beyond my own need for attention," Wright said.

Assistant US Attorney Stephanie Siegmann asked Wright about documents found on his computer, including one that encouraged Islamic State followers to kill Americans when they are walking in the streets, "thinking they are safe".

Wright also had a folder on his computer that included tweets sent by Dzhokhar Tsarnaev, who was convicted in the Boston Marathon bombing.

Siegmann pulled out the three large hunting knives Wright's uncle had purchased and asked Wright whether the weapons were fantasy or real.

She also pressed Wright about videos on his computer, including ones that showed Islamic State members beheading people on a beach.

"It was not fantasy to you that they were dying, was it?" Siegmann asked.

The third man accused in the plot, Nicholas Rovinski, pleaded guilty last year to conspiracy charges and faces between 15 and 22 years in prison. Rovinski, of Warwick, Rhode Island, testified against Wright.