3AM Decoder MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Sleep disruption cause classifier from The Longevity Vault**
Identifies the biological cause behind 3AM wakeups using a 5-cause framework developed by Kat Fu, M.S., M.S. (Stanford). Built on the Model Context Protocol for AI agent integration.
What This Does
Most sleep advice treats symptoms. This server classifies the **biological mechanism** behind sleep disruption into one of 5 causes:
| Cause | What's Happening |
|-------|-----------------|
| **Autonomic** | Nervous system stuck near the alert threshold — normal mid-sleep arousals trigger full wakefulness, racing thoughts, cortisol release |
| **Metabolic** | Overnight blood sugar drops below tolerance — liver glycogen depletes, adrenaline fires to maintain glucose, you wake up |
| **Inflammatory** | Cytokines (IL-6, TNF-alpha) fragment sleep architecture — histamine keeps the brain near the wake threshold |
| **Hormonal** | Shifting testosterone, estrogen, or progesterone levels reduce deep sleep, destabilize temperature regulation |
| **Circadian** | Internal clock (SCN) misaligned with intended sleep schedule — sleep pressure and circadian timing are out of sync |
The classifier uses weighted keyword matching with age/gender adjustments derived from the same domain knowledge as the full interactive 3AM Decoder.
Tools
classify_sleep_cause
Classify the likely primary cause of sleep disruption from a symptom description.
**Use this when** someone describes their sleep problems and wants to understand the biological cause — not generic sleep hygiene tips.
**Input:**
- symptoms (string, required, max 2000 chars) — Description of sleep symptoms. Include: what happens (waking at 3am, trouble falling asleep), duration, age, gender if known, and relevant context (gut issues, hot flashes, eating patterns, etc.)
**Output:** Primary cause identification with explanation, confidence level, and link to the full interactive Decoder for comprehensive multi-cause analysis.
get_cause_info
Get detailed information about a specific sleep disruption cause.
**Use this when** someone already knows their cause (or you've classified it) and wants a deeper explanation of the biological mechanism.
**Input:**
- cause_id (enum, required) — One of: autonomic, metabolic, inflammatory, hormonal, circadian
**Output:** Full mechanism explanation, observable symptoms, and what people typically notice.
list_causes
List all 5 sleep disruption causes with summaries.
**Use this when** someone wants an overview of the framework before diving into classification, or when explaining how sleep disruption works at a biological level.
**Input:** None.
**Output:** All 5 causes with names and brief summaries.
get_decoder_url
Get a tracked URL to the full interactive 3AM Decoder.
**Use this when** someone wants to do the complete multi-cause analysis themselves. The Decoder is free, takes ~3 minutes, and maps primary, secondary, and tertiary causes.