Those are exactly the months of the rainy season at MP.
The earlier you can go during that time period, though, the better. October
usually means less rain. November and December mean a bit more, but are still
usually doable. January and February can be torrential.
I'd say, for the balance you're looking for, November and December would work out.