Skip to main content
Glama
carolinefebraga

Mental Health MCP

mental_health_mcp

Этот репозиторий предназначен для отправки материалов, необходимых для настройки mental health MCP.

Как использовать проект с Claude (Windows)

1. Установка Claude Desktop

  1. Перейдите на официальный сайт Anthropic: https://claude.ai/download

  2. Скачайте версию для Windows

  3. Установите как обычно и откройте приложение


2. Настройка MCP (Model Context Protocol)

Claude Desktop позволяет интегрировать внешние инструменты через MCP.

Расположение файла конфигурации:

В Windows файл находится по адресу:

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

Если его не существует, вы можете создать файл вручную.


3. Добавление MCP-сервера

Откройте файл claude_desktop_config.json и добавьте:

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

Замените:

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

на реальный путь, где находится файл server.js.


4. Запуск сервисов

Перед использованием в Claude необходимо запустить:

🔹 Backend (FastAPI)

В терминале:

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

🔹 Публикация API через ngrok

ngrok http 8000

Скопируйте сгенерированный URL (например, https://xxxx.ngrok-free.dev)


🔹 Обновление server.js

В файле server.js обновите URL API:

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

Запуск MCP Server

node server.js

5. Использование в Claude

  1. Откройте Claude Desktop

  2. Перейдите в Settings (Настройки)

  3. Перейдите в раздел Developer / MCP

  4. Убедитесь, что сервер отображается как активный

  5. При начале разговора используйте кнопку "+" для доступа к инструменту


Важное предупреждение

Эта система была разработана с намеренными ограничениями для предотвращения этических рисков, она не ставит диагнозы и не дает клинических рекомендаций.

Она действует только как помощник для эмоциональной поддержки и не заменяет профессиональное наблюдение.


Примечания

  • Система использует базу знаний на Python

  • Ответы основаны на ключевых словах и заданных правилах

  • Claude выступает в качестве разговорного интерфейса с использованием MCP


Готово!

После выполнения этих шагов Claude будет интегрирован с вашим MCP-сервером и сможет использовать ваш API эмоциональной поддержки.

Разработанная архитектура:

Related MCP server: Emotion Dataset Analysis MCP Server

Архитектура системы

Проект состоит из трех основных уровней:

1. API на Python (FastAPI)

API было разработано с использованием фреймворка FastAPI и отвечает за:

  • Получение сообщения пользователя

  • Обработку текста (нормализация и анализ)

  • Запрос к базе знаний (knowledge_base.py)

  • Идентификацию возможных эмоциональных паттернов

  • Возврат структурированного ответа с:

    • поддерживающим сообщением

    • рекомендациями по уходу за собой

    • уровнем риска

    • этическим предупреждением

📍 Основной эндпоинт:

POST /chat

Пример запроса:

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

Пример ответа:

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

Логика API основана на правилах и ключевых словах, что гарантирует предсказуемость и контроль ответов.


2. База знаний (knowledge_base.py)

База знаний содержит:

  • Эмоциональные категории (например, тревога, грусть, стресс)

  • Связанные ключевые слова

  • Предопределенные ответы

  • Рекомендации по уходу за собой

  • Критические слова (для обнаружения повышенного риска)

Эта структура позволяет системе работать без зависимости от внешних моделей, используя детерминированную логику.


3. MCP-сервер (Node.js)

MCP-сервер работает как посредник между Claude и API на Python.

Обязанности:

  • Получение вызовов от Claude (через MCP)

  • Пересылка запросов к API FastAPI

  • Возврат ответа API в Claude

Поток:

  1. Пользователь отправляет сообщение в Claude

  2. Claude активирует инструмент через MCP

  3. MCP (Node.js) отправляет HTTP-запрос к API Python

  4. API обрабатывает и возвращает ответ

  5. MCP возвращает результат в Claude

  6. Claude отображает ответ пользователю


4. Публикация API (ngrok)

Поскольку Claude не имеет доступа к localhost, для публикации API был использован ngrok:

ngrok http 8000

Это генерирует публичный URL, который используется MCP-сервером.


Полный поток системы

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

Технические соображения

  • Система не использует генеративный искусственный интеллект для принятия клинических решений

  • Вся логика основана на контролируемых правилах

  • Claude выступает только как разговорный интерфейс

  • MCP обеспечивает безопасную интеграцию между моделью и внешними системами


Цель архитектуры

Обеспечить:

  • контроль ответов

  • этическую безопасность

  • простоту обслуживания

  • интеграцию с современными инструментами (MCP + LLM)

Available Tools

1 tool
mental_health_helperD

Assistente de apoio emocional

NameRequiredDescriptionDefault
messageYes

TDQS

D1.5/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description 'Assistente de apoio emocional' gives no insight into the tool's behavior: it doesn't indicate whether this is a read-only or mutating operation, what kind of response to expect, whether it requires authentication, any rate limits, or potential side effects. For a tool with zero annotation coverage, this is a complete lack of transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—a single Portuguese phrase—but this brevity comes at the cost of being under-specified rather than efficient. While it's front-loaded (the entire description is one phrase), it fails to convey necessary information. Conciseness should not sacrifice clarity; here, the description is too sparse to be helpful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a mental health tool with no annotations, no output schema, and 1 undocumented parameter), the description is completely inadequate. It doesn't explain what the tool does, how to use it, what behavior to expect, or what the parameter means. For a tool that could involve sensitive emotional interactions, this lack of context is particularly problematic and fails to meet minimum viability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, meaning the schema provides no documentation for the 'message' parameter. The description adds no information about parameters—it doesn't explain what the 'message' should contain (e.g., 'a user's emotional query', 'a description of feelings'), its format, or examples. With low schema coverage and no compensation from the description, parameters remain entirely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Assistente de apoio emocional' (Emotional support assistant) is a tautology that essentially restates the tool name 'mental_health_helper' in Portuguese. It doesn't specify what action the tool performs (e.g., 'provides emotional support responses', 'analyzes emotional state', 'offers coping strategies') or what resource it operates on. While it hints at the domain (emotional support), the purpose remains vague and lacks a clear verb+resource combination.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool. It doesn't specify the context (e.g., 'when a user expresses emotional distress', 'for general mental health queries'), mention any prerequisites, or differentiate it from alternatives (though there are no sibling tools, it still fails to define its scope). Without any usage context, the agent has no basis for deciding when to invoke this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev1.0.0
    • First observedmental_health_helper

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 issues

Related MCP Connectors

Related MCP Servers