The 32-year-old had signed a two-year deal with the Prenton Park club in June after being released by Barnsley.
Foster started Tranmere's first five games of the season but was not involved in Tuesday's Capital One Cup victory against Bolton Wanderers.
"I wish him the best of luck in his future," Tranmere boss Ronnie Moore told the club's official website.
"After discussing things with Stephen it was agreed that it was in the best interests of both parties if we part company.
"It leaves us short in an important position but I hope to bring in a replacement as soon as possible."
Tranmere face Oldham Athletic in League One on Saturday.