9 speed cassette to put 42 teeth
9 speed 11-36 is a common maximum cassette size. 

42 would probably be too large for a 9 speed dérailleur to work reliably (Only 11 are specified to cope with 42 ). You would likely have trouble with the B screw adjustment, requiring a longer B screw or other hacks to get the dérailleur to clear the large cog. Even if you did succeed, the chain wrap would be minimal, increasing wear on chain and cogs. 

You don't say what the chaining sizes are on your MTB, or your wheel size. A better option would be a smaller chain ring.