There are some preexisting solutions, and some which technically aren't, but you can easily create them.
If all commands you want to execute are "verbatim" on each router (i.e. there's no difference at all), you can use tools like
this one to execute each command on all routers via SSH.
If you need a little more finesse - i.e. if the changes you need are the same "except that one thing", you can either create a RouterOS script that detects the router it's running on and acts accordingly (and run it in the same fashion as above) OR build a simple API application where you prepare a script with variables, and then run it.
API applications are a better option if what you need is likely to repeat, i.e. they're better for automation. But if you're doing a "one time thing", it's easier to use tools like the above.