The series of events by which a mechanical stimulus is received and converted into a molecular signal.