Mecha Ridley is split into two phases each with their own health. The first phase is with the glass covering his weak spot which takes 10 missiles to break, or 2 super missiles. Once the glass breaks he'll enter his second phase which takes another 18 missiles, or 4 super missiles, to finish him off. If you've collected 100% of the items before starting the fight, Mecha will have triple his health on both phases and deal double damage.
Mecha has 3 attacks which he can do in any order and sometimes do 2 or even all 3 attacks simultaneously. He can swipe his claw at you, he can fire 3 missiles off his back which track samus, or he can spit fireballs. Once you've broken the glass on his chest and enter the 2nd phase of the fight, he will no longer spit fireballs but instead fire lasers out of his eyes.
In any% you should have at least 6 super missiles for Mecha. The main idea is to fire all 6 into his weak spot to kill him as fast as you can, which there are safer ways and riskier but faster ways to do so. The fastest way to kill him is to do a full jump right before the music starts, this causes him to raise his head and expose his weak point faster. Then fire all 6 supers in rapid succession to immediately kill him. This strat is risky because there's a random chance Mecha will do nothing and let you kill them, and also a random chance he'll swipe or spit fireballs and cause you to miss your supers. This is known as the YOLO kill because of the risk involved.
The Controlled YOLO kill is a similar but safer strat where you start the fight in the exact same way but only fire 1 super missile. If you pause for a second after the first shot, mecha will be locked into one of 3 patterns which you can then react to. He could either immediately swipe, he could wait a second and then swipe, or he could spit fireballs. Once you see what he's doing you can safely fire the rest of your supers while reacting to his attack.
If the initial jump to start the fight is too hard to get down, the safest way to fight mecha is just to stay crouched in the corner and wait for him to swipe his claw and raise his head. This is a random chance for how long it takes him to do this, so you could get a pretty quick fight if you're lucky or you could be sitting there for 10+ seconds waiting for a swipe. This is the safest strat because once he swipes you're pretty much guaranteed to have a long enough opening to kill him with all 6 supers.
The 100% fight is exactly the same as any% except it's going to take 6 supers to break the glass and another 12 to finish him off, so 18 supers total to kill mecha. You can do a similar YOLO strat to try and kill him as fast as possible if you're feeling risky like so:
Or you can always take a safer approach and fire a few supers to start the fight and wait to see and react to what his attacks are. In 100% you should have full health and plenty of ammo to eventually kill him.
This is one of the toughest fights in a 9% run. The best advice for this fight is to practice practice practice and get used to all of his attacks and patterns and know how to dodge them. If you can be comfortable enough to just sit in mecha's room and hang out with him without getting hit by any of his attacks, you can eventually kill him. There are a lot of small nuances to Mecha's behavior that don't really matter in any other situation besides the low% fights:
In Mecha's first phase he can occasionally shoot fireballs at you. This is mostly a waste of time because it's very difficult to return fire without taking damage, but it is possible to prevent him from shooting fireballs. I've noticed in my practice that as long as you have 0 missiles, mecha won't shoot fireballs, so while the glass is still on his chest you will always want to fire all your ammo at him as soon as you collect it. You may see some instances where you'll fire your last missile and mecha will immediately shoot fireballs when you're at 0 missiles, but I believe this is when he has already had his fireball attack queued up and ready to go before you ran out of ammo, so you need to be quicker in firing your missiles to prevent that.
If you stay against the left and crouched, his claw can't reach you so you're completely safe from the claw attack by itself. You can usually shoot all 3 missiles he'll fire at you from this position, but sometimes they'll swerve at you in a way where you need to jump and fire straight down to dodge them. This gets tricky if he swipes and missiles at the same time because you'll need to time your jump to either be above the claw before it swipes, or jump after the claw is on the ground. Another thing to watch out for is if he swipes right before the missiles reach you, his claw can overlap the missiles and prevent you from shooting them. In this case you'll want to jump after the claw is on the ground and shoot the missiles as they swerve underneath you.
You may notice Mecha is slowly crawling towards you during the fight, especially when he swipes. If you hit him with a missile, he'll back up away from you. This becomes important during the 2nd phase with his laser eyes because it's easier to dodge the lasers when they're farther away. The lasers always fire at the same 3 angles, a steep angled down, a slight angled down, and straight ahead, which means the lasers will end up landing in the same places as long as his head is in the same position. Most of the time Mecha's head is either lowered all the way or raised all the way, he doesn't often just leave it in between. If his head is lowered all the way, and mecha has crawled closer to you, then the laser won't hit you in the corner. Also if mecha's head is raised all the way up, and he's pushed back as far back as he can go, the laser also can't hit you if you're morphed in the corner. So with this in mind it's usually to your advantage to try and keep mecha pushed back as often as possible and keep his head raised by jumping near the ceiling whenever possible, all of this is to make the lasers easier to dodge. It can get really hectic with the lasers and claw swipes at the same time, and the best ways to dodge everything is either to be space jumping above the claw and ready to jump above or below any high laser shots, or just stay morphed on the ground against the wall and roll to the right when you see a low laser shot going at the corner.