It is the main story. Literally all KH games, numbered or not are part of the main story.
True, and the series is worse for it.
I played all the games, and it became very apparent to me after beating KH3 that it was very unnecessarily stretched out with Shamalan level twists to keep us reeling and ultimately couldn't come to a good conclusion after so many convoluted plot threads. The series story was still strong by Birth By Sleep, but the cell phone games and DDD is where they screwed the pooch in plot lines. I don't think I have ever been more dissatisfied with a conclusion of what started as an epic tale. This includes Game of Thrones.
PSN:Forevercloud (looking for Soul Sacrifice Partners!!!)