grub should have an optional dependency on mdadm since its binary is called in grub-core/osdep/linux/getroot.c
It's an optional runtime dependency. If your system is running mdraid, you'll have mdadm installed anyway.