I would caution against getting overly invested in solving your kiddo's boredom. It is one of the best gifts my mother gave me. If I said I was bored, I found a dish cloth or gardening hoe in my hand within seconds. Because she wouldn't solve my boredom for me, I discovered a love for reading, climbing trees, riding my bike, and writing stories. I did the same for my kids, and it is amazing the things they decided to try to keep from telling me they were bored. It builds self-comforting and self-sufficiency when we don't take the driver's seat to solving an issue that should rest with our kids.
Solving his loneliness is quite another thing. If he can't find like-minded kids or doesn't make friends easily, I second the recommendation to start a club at school. Not only will the school be glad for the help, but you'll be able to have a bird's eye view of his interactions with his peers without being overly involved.