How to automatically add counted number to navigation menu items?

Declare menu_count = 0; before your foreach and then within your foreach you’ll need to include $menu_count++; and then you could add $menu_count as an attribute, or a label.

You will need to make a custom function for this, so be sure to check out the codex on wp_get_nav_menu_items