@gonzih/ai-mood-journal
v0.1.0
Published
MCP server for children's daily mood check-ins with AI, spiral detection, and weekly parent digests
Downloads
100
Readme
ai-mood-journal
An MCP (Model Context Protocol) server for children's daily mood check-ins, emotional pattern tracking, and weekly parent digest reports — all stored locally with end-to-end encryption.
Motivation
Adolescent mental health is a growing concern. Research consistently shows that early detection of mood changes, coupled with warm parental engagement, significantly improves outcomes for children and teens. This tool gives parents a gentle, privacy-preserving way to stay connected to their child's emotional wellbeing — without surveillance or pressure.
The design is intentionally non-clinical: check-ins feel like a natural part of AI conversations, not a therapy session. Data never leaves the local machine. Parents receive warm, actionable summaries — not raw transcripts.
Installation
1. Install dependencies
npm install2. Configure environment variables
Copy .env.example to .env and fill in the values:
cp .env.example .envRequired:
MOOD_JOURNAL_DB— path to SQLite database file (default:~/.ai-mood-journal/journal.sqlite)MOOD_JOURNAL_ENCRYPT_KEY— 32-byte encryption key (hex or base64); generate with:node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Optional (for notifications):
- Telegram:
TELEGRAM_BOT_TOKEN,TELEGRAM_PARENT_CHAT_ID - Email:
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASS,SMTP_FROM,SMTP_TO
3. Build
npm run build4. Configure Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"ai-mood-journal": {
"command": "node",
"args": ["/path/to/ai-mood-journal/dist/index.js"],
"env": {
"MOOD_JOURNAL_PROFILE_ID": "alex",
"MOOD_JOURNAL_CHILD_NAME": "Alex",
"MOOD_JOURNAL_CHILD_AGE": "13",
"MOOD_JOURNAL_DB": "~/.ai-mood-journal/journal.sqlite",
"MOOD_JOURNAL_ENCRYPT_KEY": "your-32-byte-hex-key",
"TELEGRAM_BOT_TOKEN": "optional",
"TELEGRAM_PARENT_CHAT_ID": "optional"
}
}
}
}Or using npx after publishing:
{
"mcpServers": {
"ai-mood-journal": {
"command": "npx",
"args": ["-y", "@gonzih/ai-mood-journal"],
"env": { "...": "..." }
}
}
}MCP Tools
check_in
Log a child's daily mood check-in. One entry per day per profile (upserts on repeat calls).
Input:
{
"profileId": "alex",
"mood": "okay",
"freeText": "Had a rough day at school but practice was fun."
}Mood values: great (5) | okay (3) | not_great (2) | frustrated (2) | anxious (2) | tired (2) | numeric 1-5
Output:
{
"logged": true,
"streakDays": 5,
"encouragement": "Thanks for sharing! Remember, okay days are perfectly fine. 😊",
"flags": []
}Automatically detects crisis language and sends an immediate alert if found.
get_mood_summary
Get mood trends and concern flags over a rolling window.
Input:
{ "profileId": "alex", "days": 7 }Output:
{
"avgMood": 3.2,
"trend": "stable",
"flags": [],
"topTopics": ["school", "friends"],
"streakDays": 5
}Trend values: improving | declining | volatile | stable
get_weekly_digest
Generate a warm, narrative weekly summary for parents.
Input:
{ "profileId": "alex", "weekStart": "2026-03-15" }Output:
{
"digest": "📊 Alex's Week in Review — Mar 15 – Mar 21\n\n...",
"flags": []
}The digest is cached in the database for the given week.
list_entries
Retrieve recent mood entries (free text is decrypted before returning).
Input:
{ "profileId": "alex", "limit": 30 }Output: Array of mood entry objects with decrypted free_text, parsed topics array, mood scores, and dates.
send_digest
Generate the digest for the current week and send it via Telegram (preferred) or email (fallback). Updates sent_at in the database.
Input:
{ "profileId": "alex" }Output:
{ "sent": true, "channel": "telegram" }get_guidance
Get parent-facing guidance and resources for a specific concern flag.
Input:
{ "flag": "persistent_anxiety" }Output:
{
"guidance": "Anxiety appearing frequently. Ask: 'What's feeling heavy right now?'...",
"resources": ["childmind.org/article/anxiety-in-children", "anxietycanada.com/resources"]
}Flag values: consecutive_low_mood | declining_trend | acute_drop | persistent_anxiety | social_withdrawal | crisis_language
Privacy
- Local-only storage: All data lives in a SQLite file on your machine. Nothing is sent to any cloud service.
- Encrypted free text: Children's reflective writing is encrypted with AES-256-GCM before being written to disk. The key never leaves your environment.
- Theme-only digests: Parent reports surface topics and mood trends — never verbatim child quotes.
- Optional notifications: Telegram/email are opt-in. If not configured, alerts are only visible in the tool output.
Crisis Protocol
If a child's free text contains language suggesting self-harm or suicidal ideation, the server:
- Immediately fires
sendAlert()with a crisis-prefixed message to the configured Telegram/email channel. - Returns
'crisis_language'in theflagsarray of thecheck_inresponse.
The AI layer (per SKILL.md) should halt the normal session and respond with warm, direct encouragement to involve a trusted adult.
Crisis resources always included in get_guidance('crisis_language'):
- 988 Suicide & Crisis Lifeline: call or text 988 (US)
- Crisis Text Line: text HOME to 741741
- NIMH Suicide Prevention: nimh.nih.gov/health/topics/suicide-prevention
Configuration Reference
| Variable | Required | Description |
|---|---|---|
| MOOD_JOURNAL_PROFILE_ID | No | Default profile ID |
| MOOD_JOURNAL_CHILD_NAME | No | Child's name for digest reports |
| MOOD_JOURNAL_CHILD_AGE | No | Child's age |
| MOOD_JOURNAL_DB | No | Path to SQLite file (default: ~/.ai-mood-journal/journal.sqlite) |
| MOOD_JOURNAL_ENCRYPT_KEY | Recommended | 32-byte key as hex (64 chars) or base64 |
| TELEGRAM_BOT_TOKEN | No | Telegram bot token for notifications |
| TELEGRAM_PARENT_CHAT_ID | No | Telegram chat ID for parent notifications |
| SMTP_HOST | No | SMTP server hostname |
| SMTP_PORT | No | SMTP port (default: 587) |
| SMTP_USER | No | SMTP username |
| SMTP_PASS | No | SMTP password |
| SMTP_FROM | No | Sender address |
| SMTP_TO | No | Recipient address |
| DIGEST_DAY | No | Day for weekly digest (default: sunday) |
| DIGEST_TIME | No | Time for weekly digest (default: 18:00) |
Research Foundation
This tool draws on established research in adolescent psychology and mood tracking:
- Beck, A.T. (1979). Cognitive Therapy of Depression. Guilford Press.
- Hankin, B.L., & Abramson, L.Y. (2001). Development of gender differences in depression: An elaborated cognitive vulnerability–transactional stress theory. Psychological Bulletin, 127(6), 773–796.
- Kovacs, M. (1992). Children's Depression Inventory. Multi-Health Systems.
- Lewinsohn, P.M., Hops, H., Roberts, R.E., Seeley, J.R., & Andrews, J.A. (1994). Adolescent psychopathology: I. Prevalence and incidence of depression and other DSM-III-R disorders in high school students. Journal of Abnormal Psychology, 102(1), 110–120.
- Nolen-Hoeksema, S. (1991). Responses to depression and their effects on the duration of depressive episodes. Journal of Abnormal Psychology, 100(4), 569–582.
- Silk, J.S., Steinberg, L., & Morris, A.S. (2003). Adolescents' emotion regulation in daily life: Links to depressive symptoms and problem behavior. Journal of Youth and Adolescence, 32(6), 365–376.
License
MIT © Gonzih
