Currently there is no feature to let a game master specify that a NPC's attacks are spell attacks instead of the default weapon attacks. An example creature where it should day spell attack is the Deathlock Mastermind's Grave Bolt attack from Mordekainen Monsters of the Multiverse.