You need a mechanical license agreement if you are planning to do the following:
1.) You are planning to cover song written by another songwriter and sell it on a CD or any mechanical forms of recording (vinyl, cassette tape).
2.) You are a movie producer and you plan to incorporate the song in the movie and sell it on a CD, DVD, Blue ray, etc.
3.) You have mp3 songs in your computer and you plan to burn it on a CD and sell it to your friends or any of your customers.
4.) You are a recording label and you are releasing an album with songs written by someone else.
All of those 4 items above, you need to ask permission from the music publisher and if the request is granted, the music publisher will issue you mechanical license.
Aside from getting the license, you also need to pay associated mechanical license fee (depending on the terms agreed).
The mechanical license fee is mandated by law. and some computational information here about the cost involved.
Some of the confusing aspects of mechanical licensing are WHERE to get this license. Typically:
1.) If the songwriter is not affiliated with any music publisher or any mechanical licensing organization.
The songwriter can execute mechanical license agreement. The songwriter needs an entertainment lawyer to do this right.
2.) If the songwriter is affiliated with a music publisher, and the music publisher is NOT affiliated with any mechanical licensing association, then the music publisher can execute mechanical licensing agreement.
3.) If the music publisher representing the songwriter is affiliated with a mechanical licensing association, then you need to contact the said association for a complete mechanical licensing agreement package (depends on your use and application).
The only mechanical licensing association I know that represents music publishers and songwriters is Harry Fox Agency.
So first, it might be worth your time to consult this website and see if the material you need has been represented by Harry Fox Agency. They have a user-friendly website that allows you to search their entire catalog.