It's so hard to let our kids go on their own, and encourage them to reach out. But at this age, you have to.
Brainstorm some conversation starters - how did you do on the test, did you understand what that teacher was talking about, when is the homework due, what day do we have Library…but try to make them more open-ended (not yes/no answers). There's also the slightly risky question of "May I join you for lunch?" or "Is anyone sitting here?" or "Can I play?" Yes, there's a chance for rejection, but maybe she'll be welcomed (and if she isn't, she'll learn that that group is not worth pursuing.
The other thing is to look around - who else is sitting alone in the lunch room, or scanning the room on arrival looking for a place to sit. Seek out those kids - they're in the same boat your daughter is. One thing a lot of kids do at this age is only see things from their own vantage point: I'M unsure, I'M alone, I'M nervous. One way to get a friend is to BE one.
She'll also find friends in time - teaching a child patience, along with their own responsibility in making gestures, is critical at this age. In fact, she's got to learn to go directly to her teachers for help on different subjects rather than having Mom and Dad do that for her. Middle School is when there is an increased expectation that kids will shoulder some of that burden (and freedom!) themselves. Teachers are also an important link for kids socially - so it's okay to go up to a teacher she feels a connection with and say, "You know, I'm having trouble breaking into the social scene. Is there anyone in the class that you think would be a good match for me or who needs a buddy?"
But I agree with others that you shouldn't over-rehearse this. Kids at this age are so self-conscious in some ways, it doesn't help if they feel they have to play a role and say exactly the right lines they practiced at home. And one of the hardest things for a parent is to back off, give the kid some confidence in her own ability, and let her work it out on her own.