How do I deal with my mentor giving first authorship of my project to a graduate student?
From what you describe, confrontation might not necessarily net you what you want (first author position), given the relationship between your advisor and the graduate student. If you don't confront him, at the very worst you still have a co-authored paper and a strong letter of recommendation, which is not too shabby. I understand it is unfair but undergraduates generally have very little bargaining power to begin with.