Khalid Rashad, 63, is on trial at the Old Bailey charged with having about 8oz (226g) of explosives, a 9mm cartridge and five 8mm rounds.
Police uncovered the explosives during a search of Rashad”s terraced home and outbuilding in Monks Park, Wembley, north London, in April last year.
The building contractor has denied wrongdoing, claiming that someone else must have put it in the garage that he had built in his garden.
Giving evidence, Rashad told jurors that he was Jamaican and had changed his name when he converted to Islam in 1993.
He became a leading figure at the An-Noor Cultural and Community Centre in Acton, West London, although there were “tensions” between the cultures.
In 2012, Rashad said he was contacted by MI5 agents who invited him to a meeting in Whitehall.
He told jurors: “I travelled to Whitehall. I had a meeting in this building in Whitehall and I was there for almost three hours and I was invited to become an operative – a spy. I was asked to work for the service.”
Asked by defence barrister Alphege Bell what they wanted him to do, Rashad said it was to spy on the Muslim community.
He said: “I was a leader in the Islamic community in west London and they would like to have someone like me in charge on the books.”
Rashad told jurors he did not want to be “deceitful to the people I”m serving” and refused their offer but said he was “more than happy to work with them openly”.
At a second meeting at a hotel in Hammersmith, the defendant said he was shown photographs of Muslim men who security services believed may be travelling out of the country.
But again, Rashad said he refused to spy on any young men and be a “secret agent”.
Mr Bell asked if he had any views on whether the security services were connected with the explosives in his garage.
The defendant replied: “At the end of the day I cannot say I have because I have not seen anyone who put this thing there so I cannot point the finger and say I believe it”s them.”
Rashad denies possessing an explosive substance and two counts of possessing ammunition without a firearm certificate.
The trial continues.