Colorado's star player showed directly why his presence in Stockholm makes Canada the big gold favorite.
The 29-year-old has a radiant NHL season behind him. He gathered 116 points (32 goals + 84 assists) and finished second in the scoring league after Nikita Kucherov, Tampa Bay.
He was also elected the most valuable player when Canada won the Four Nations in the winter.
MacKinnon started the World Championship by setting up Bo Horvath to Canada's leading goal, in numerical superiority after 7.22.
But Slovenia fought back, showed no excessive respect for the renowned Canadians and created some clear equalizing opportunities.
Dylan Garand, who started instead of star Marc-André Fleury, had to work hard between the posts. Closest to an equalizing situation after the first period was a Slovenian post shot in a 5-on-4 play.
Instead, MacKinnon scored his first World Championship goal in 2025, between the legs of Lukas Horak.
MacKinnon played again to set up New York Islanders finisher Horvath, who got to celebrate his second goal in the Avicii arena.
Canada's fourth goal was scored by Noah Dobson.
Tre Kronor will meet Canada in the last group stage round on 20 May.
In parallel with the match in Globen, Norway got a tough World Championship start in the second group (B) which is decided in Herning. Kazakhstan won with 2–1.