Skip to main content
Glama
Mental Health MCP

Mental Health MCP

mental_health_mcp

This repository is intended for sending the necessary materials to configure the mental health MCP.

How to use the project with Claude (Windows)

1. Install Claude Desktop

  1. Access the official Anthropic website: https://claude.ai/download

  2. Download the version for Windows

  3. Install normally and open the application


2. Configure the MCP (Model Context Protocol)

Claude Desktop allows you to integrate external tools via MCP.

Configuration file location:

On Windows, the file is located at:

C:\Users\SEU_USUARIO\AppData\Roaming\Claude\claude_desktop_config.json

If it does not exist, you can create the file manually.


3. Add the MCP server

Open the claude_desktop_config.json file and add:

{
  "mcpServers": {
    "Mental Health MCP": {
      "command": "node",
      "args": ["C:\\caminho\\para\\seu\\projeto\\server.js"]
    }
  }
}

Replace:

C:\\caminho\\para\\seu\\projeto\\server.js

with the actual path where the server.js file is located.


4. Start the services

Before using it in Claude, you need to start:

🔹 Backend (FastAPI)

In the terminal:

cd mental_health_mcp
source venv/bin/activate  # ou venv\Scripts\activate no Windows
uvicorn main:app --reload

🔹 Expose API with ngrok

ngrok http 8000

Copy the generated URL (example: https://xxxx.ngrok-free.dev)


🔹 Update server.js

In the server.js file, update the API URL:

const API_URL = "https://xxxx.ngrok-free.dev/chat";

Start MCP Server

node server.js

5. Use in Claude

  1. Open Claude Desktop

  2. Go to Settings

  3. Access the Developer / MCP section

  4. Verify that the server appears as active

  5. When starting a conversation, use the "+" button to access the tool


Important notice

This system was designed with intentional limitations to avoid ethical risks, not performing clinical diagnoses or recommendations.

It acts only as an emotional support assistant and does not replace professional care.


Observations

  • The system uses a knowledge base in Python

  • Responses are based on keywords and defined rules

  • Claude acts as a conversational interface using MCP


Ready!

After these steps, Claude will be integrated with your MCP server and will be able to use your emotional support API.

Architecture developed:

Related MCP server: Emotion Dataset Analysis MCP Server

System Architecture

The project consists of three main layers:

1. Python API (FastAPI)

The API was developed using the FastAPI framework and is responsible for:

  • Receiving the user's message

  • Processing the text (normalization and analysis)

  • Querying the knowledge base (knowledge_base.py)

  • Identifying possible emotional patterns

  • Returning a structured response with:

    • support message

    • self-care suggestions

    • risk level

    • ethical warning

📍 Main endpoint:

POST /chat

Request example:

{
  "message": "Não me sinto bem hoje"
}

Response example:

{
  "response": "Entendo. Você pode me contar um pouco mais sobre o que vem sentindo?\n\n[...]",
  "risk_level": "low"
}

The API logic is based on rules and keywords, ensuring predictability and control of responses.


2. Knowledge Base (knowledge_base.py)

The knowledge base contains:

  • Emotional categories (e.g., anxiety, sadness, stress)

  • Associated keywords

  • Pre-defined responses

  • Self-care suggestions

  • Critical words (for high-risk detection)

This structure allows the system to function without relying on external models, using deterministic logic.


3. MCP Server (Node.js)

The MCP server acts as an intermediary between Claude and the Python API.

Responsibilities:

  • Receive calls from Claude (via MCP)

  • Forward requests to the FastAPI API

  • Return the API response to Claude

Flow:

  1. User sends a message in Claude

  2. Claude triggers the tool via MCP

  3. MCP (Node.js) sends an HTTP request to the Python API

  4. API processes and returns a response

  5. MCP returns the result to Claude

  6. Claude displays the response to the user


4. API Exposure (ngrok)

Since Claude does not access localhost, ngrok was used to expose the API:

ngrok http 8000

This generates a public URL that is used by the MCP server.


Complete System Flow

Usuário → Claude → MCP (Node.js) → API (FastAPI) → Base de Conhecimento
                                             ↓
                                      Resposta estruturada
                                             ↓
Usuário recebe resposta no Claude

Technical Considerations

  • The system does not use generative artificial intelligence for clinical decisions

  • All logic is based on controlled rules

  • Claude acts only as a conversational interface

  • MCP allows secure integration between the model and external systems


Architecture Objective

Ensure:

  • control of responses

  • ethical safety

  • ease of maintenance

  • integration with modern tools (MCP + LLMs)

Available Tools

1 tool
mental_health_helperD

Assistente de apoio emocional

Inputs: message (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.1/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'mental_health_helper' has a distinct and clear purpose as an emotional support assistant.

    Naming Consistency5/5

    The single tool name 'mental_health_helper' follows a clear and consistent pattern with snake_case and a descriptive noun_verb structure. With only one tool, naming consistency is inherently perfect.

    Tool Count2/5

    A single tool is too few for a server named 'Mental Health MCP', which suggests a broad domain. While the tool description indicates emotional support, the scope feels thin, lacking coverage for other potential mental health aspects like resources, assessments, or tracking.

    Completeness2/5

    The tool set is severely incomplete for a mental health domain. It only provides emotional support assistance, with obvious gaps such as accessing mental health resources, self-assessment tools, crisis management, or progress tracking, which are common in this context.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers