The 29-year-old links up again with Shrimps boss Derek Adams, having previously played for him at Plymouth Argyle.
His footballing CV also includes spells with Crewe Alexandra and Blackpool, both of whom he has helped to win promotion out of League Two.
Mellor told the club website: “I’m delighted to get it done.
“Obviously I’ve worked with the gaffer before so I know what he’s about. I’m really happy to be here and get this move over the line.
“I’ve been speaking with the gaffer over the past few weeks and after such a long lay-off with everything that’s gone on, there are a lot of lads out of contract so I’m thankful that I’ve been able to get sorted and I’m ready for the season to begin now.”
Mellor’s arrival also means Adams now has the 20 senior players and two first-year professionals at his disposal he had targeted last month.
“Kelvin comes in from Bradford with good experience,” Adams added.
“He was with me at Plymouth a number of seasons ago, can play at right-back or right centre-half, he’s a very good football player and can get forward, create chances and score goals.”