The team’s official Facebook page announced the ex-Barcelona and Milan forward, 46, will be the team’s coach from next season.
The 1980 Moroccan champions are currently top of the third division halfway through the season.
Mohammedia last played in the Moroccan top-flight in 2009.
The club is based 25km from Casablanca and was founded in 1948 making it one the country’s oldest clubs.
The club is owned by one of the wealthiest men in the area Hicham Ait Menna, who is in the real estate business and hoping to return the club to some of its former glory.
The team’s most famous player is Ahmed Faras, who is the Moroccan national team’s all-time leading scorer with 42 goals and the 1975 African footballer of the year.
It will not be Rivaldo’s first experience of African football, having spent 2012 playing for Angolan side Kabuscorp.
Rivaldo began and ended his career in Brazil, he also played in Spain for Deportivo La Coruna and Barcelona before moving to Italian giants AC Milan.
After Italy he had stints in Greece and then Uzbekistan before returning to Brazil.