The most common food I see recommended for mealworms is wheat bran, a very cheap byproduct from processing wheat, but it really serves as bedding too. My local Hy-vee (I'm in the Midwest) has organic wheat bran for $0.99/lb in the bulk section. You can also give them rolled oats or DRIED grass I think, as they really like warm, dry environments and fresh grass clippings might have too much moisture. You can mix this in with wheat bran like half and half, but again, they like it to be pretty dry.
Mealworms don’t drink water so they do need some wet-ish stuff like veggie scraps. You don’t want your habitat to get moist and nasty, so avoid wet stuff that rots fast. This might make it so they can't really survive on just fruits and veggies alone, but you can give them peels and rinds from all kinds of fruits and vegetables that you use in your own food preparation. Peel your veggies, including carrots, potatoes and sweet potatoes, cucumbers, squash, apples, and whatnot.
More knowledgeable folks might be able to chime in though!