Purpose This study aims to explore how artificial intelligence (AI) can enhance mental health care in Tanzania, focusing on its potential to enhance mental health services and address challenges in a low-resource setting. Design/methodology/approach A qualitative case study approach was used, with data collected through semi-structured interviews and focus group discussions involving key stakeholders in mental health and AI, including policymakers, technical experts, health-care providers and patient advocacy groups. Thematic analysis was used to identify key themes related to the opportunities and barriers to AI integration in mental health care. Findings This study identified several benefits of AI in mental health care, including improved diagnostic accuracy, personalised treatment and the potential for real-time monitoring of patients. However, significant barriers to AI adoption remain, such as infrastructure limitations, data privacy concerns and the need for training and resources to effectively integrate AI into mental health services. Originality/value This study contributes to the growing literature on AI in health care by focusing on its application in mental health care in Tanzania, a low-resource setting. The research provides valuable insights into how AI can bridge gaps in mental health service delivery, particularly in underserved regions, while highlighting the challenges that must be addressed for successful implementation.