One risk with bonding a long piece of metal on something like MDF or wood regardless of the glue is differential expansion. It's hard to guess whether or not you might have an issue at 6 in, but it may well be pushing it a bit.
The way this problem is normally addressed is with a flexible adhesive and/or a thicker bondline (layer of adhesive) - the first especially is not really an option with an epoxy.
For sure it'll bond and stay put if you use epoxy, the question is for how many months/years - the epoxy being very strong but not very flexible would very possibly eventually cause the MDF to fail behind the bond. A lot would depend on how humid/changeable the environment is.
Other critical issues with epoxies are make sure you have the mix volume exactly right (the chemistry is such that a certain amount of A links with a certain amount of B - too much of one or the other weakens it), make sure they are very thoroughly mixed.
Something flexy that will cure through a thicker bond line like a high grade silicone is worth looking at - it won't stress the MDF. Here's a 'rolls royce' source with lots of choices and able to advise:
http://www.intertronics.co.uk/products/ ... m#silicone Failing that a high end bathroom type silicone would almost certainly do OK, but don't use a cheap one. Get a neutral (non acid) curing one if you can, and don't press the rule down so hard as to squeeze out too much of the silicone.
As Jimi says a double sided tape could be a good option too, but the MDF surface would need to be very smooth (otherwise it'll just contact in spots), not 'hairy' and dust free. You probably should go for one with an elastomeric/rubbery backing with a bit of thickness to accommodate a bit of out of flatness and give flexibility. Here's a source that can advise too:
http://www.tapes-direct.co.uk/index.php ... &cPath=139
Unibond have a double sided No More Nails branded permanent double sided tape much like this out now in hardware shops too, they claim it to be 'permanent' (ha!) for household bonds. It might be a good and very convenient choice.
Whatever you choose make a few trials and see how it goes. Don't forget too to sand and solvent wash the metal to help the bond - a stainless rule might be no harm either.
Pardon if this makes a meal of it, but maybe others have an interest in the topic too....