The four, among them a woman, were accused of possessing 62 pieces of Magnum Commercial Explosive gel tubes in contravention of the Explosives Act.
The court was told that they were also found in possession of bhang worth Sh100,000.
Mohamed Yusuf, Jibril Kaima, Julius Kariuki and Mwanaidi Wanjiku were denied bail and remanded for seven days at the Kilimani Police Station until July 30 when their case is due back in court.
The four were arrested following a tip-off from members of the public.
Buruburu Police Chief Richard Ng’etich said the materials they were found with could be used to assemble Improvised Explosive Devices.
The four appeared before Chief Magistrate Hannah Ndung’u where they denied the charges.
Yusuf who is a Ugandan is also facing an additional charge of being in the country illegally.
Police have since urged the public to provide such information to help combat terror threats.
Nairobi and Mombasa have been worst hit by terror attacks usually blamed on the Al-Shabaab terror group or their radicalised supporters in the country.
This was after the Kenya Defence Forces crossed into southern Somalia in 2011 to fight the group, later joining the now 22,000-strong African Union force battling the Islamists.
Al- Shabaab has since vowed revenge by carrying out attacks. In September last year, 67 people were killed when attackers besieged the upmarket Westgate shopping mall.
The group has also claimed responsibility for the recent attacks in Lamu that have left over 90 people dead but the government blames “local political networkers. ”