The movie is being produced by Jason Blum.
McAvoy, 36, will replace Joaquin Phoenix, who was previously eyed for the role, according to Deadline.
Shyamalan and Blum previously worked together in "The Visit", which brought in USD 53 million at worldwide box office against a budget of USD 5 million.
The upcoming project is said to have the same range of budget with "The Visit".
It will start filming in November in the director's hometown in Philadelphia. Blum will produce alongside Marc Bienstock with Ashwin Rajan and Steven Schneider tapped as executive producers.
Sources say it will likely include elements of the supernatural and will be a thriller movie.
McAvoy will next be seen in "Victor Frankenstein", which will arrive in the US on November 25. He plays the titular scientist in the horror film alongside Daniel Radcliffe.
McAvoy recently finished filming "X-Men: Apocalypse", in which he reprises his role as Professor X.
