Duffy joined the Shrimps on loan from Southport in March but will now be a permanent member of Sammy McIlroy's squad after signing for a fee of £20,000, with add-on clauses written into the deal.
"I have had a great time since joining on loan and was only too happy to sign," he told Morecambe's official website.
"It has been a big learning curve for me so far but I am keen to learn and keep on improving and am looking forward to next year already. The lads have been great and everyone has made me really welcome."
McIlroy believes that Duffy has great potential and added: "Everyone knows Mark is a player I have admired for a long time and I think he has a great future in the game.
"He has already shown us that he has a lot to offer with quick feet and a good attitude and I am delighted to have him at Christie Park."