@daobrew/wellness-mcp 0.1.0 โ†’ 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,98 +1,158 @@
1
- # @daobrew/wellness-mcp
1
+ # ๐Ÿต @daobrew/wellness-mcp
2
2
 
3
- Biometric stress detection & TCM-guided recovery for developers using Claude Code.
3
+ **Your coding agent just learned to read your body.**
4
4
 
5
- Reads your health data (Apple Watch, Oura Ring), detects stress patterns through Traditional Chinese Medicine theory, and plays therapeutic breathing music with binaural beats โ€” right inside your coding session.
5
+ Reads your biometrics (Apple Watch, Oura Ring), detects stress patterns, and plays therapeutic breathing music with binaural beats โ€” all without leaving your editor.
6
6
 
7
- ## Install
7
+ No popups. No app switching. Just music that fades in when you need it. ๐ŸŽง
8
+
9
+ ---
10
+
11
+ ## โšก Quick Start
8
12
 
9
13
  ```bash
10
14
  npm install -g @daobrew/wellness-mcp
11
15
  npx daobrew-wellness-setup
12
16
  ```
13
17
 
14
- Setup asks two questions (data source + ambient mode). Done in 30 seconds.
18
+ Two questions. 30 seconds. Done.
15
19
 
16
- ## What it does
20
+ Works with **Claude Code**, **Cursor**, **Windsurf**, and any MCP-compatible agent.
17
21
 
18
- - **Detects stress** from real biometrics (HRV, heart rate, steps, sleep)
19
- - **Maps to TCM patterns**: Wood/Tension, Fire/Overdrive, Earth/Stagnation, Metal/Constriction, Water/Depletion
20
- - **Plays breathing music** with binaural beats (4Hz theta) and breath-paced volume modulation
21
- - **Works inside Claude Code** โ€” no app switching, no popups
22
+ ---
22
23
 
23
- ## Usage
24
+ ## ๐Ÿง˜ What It Does
24
25
 
25
- **On-demand** โ€” ask anytime:
26
26
  ```
27
- /stress โ†’ check your current wellness state
28
- /breathe โ†’ start a breathing session for your top stress pattern
29
- /stop โ†’ stop current session
27
+ You're coding. โ†’ Agent detects stress. โ†’ Music fades in. โ†’ You keep coding.
28
+ (real biometric data) (binaural beats (stress goes down)
29
+ + breath pacing)
30
+ ```
31
+
32
+ - ๐Ÿ“Š **Detects stress** from real biometrics โ€” HRV, heart rate, sleep, activity
33
+ - ๐ŸŒฟ **Maps to 5 stress patterns** โ€” Wood/Tension, Fire/Overdrive, Earth/Stagnation, Metal/Constriction, Water/Depletion
34
+ - ๐ŸŽต **Plays genre-matched music** with 4Hz theta binaural beats and breath-paced volume swells
35
+ - ๐Ÿ”‡ **Zero interruption** โ€” ambient mode works silently in the background
36
+
37
+ ---
38
+
39
+ ## ๐ŸŽฎ Usage
40
+
41
+ ### On-demand โ€” ask anytime
30
42
  ```
43
+ /stress โ†’ "You're in Pushing It mode โ€” Fire ยท Heart Qi restlessness (score 72)"
44
+ /breathe โ†’ Lo-fi jazz fades in through your headphones ๐ŸŽง
45
+ /stop โ†’ Music stops, session result logged
46
+ ```
47
+
48
+ ### Ambient โ€” hands-free stress relief
49
+ Enable once: *"enable ambient mode"*
50
+
51
+ From then on, your agent monitors stress at natural breakpoints. When it detects a spike + you have headphones in, therapeutic music fades in silently. You keep coding. Your HRV recovers. One line at the end:
52
+
53
+ > โ™ช Session ended. HRV 28ms โ†’ 41ms (+46%), HR 82 โ†’ 71bpm.
54
+
55
+ Say *"disable wellness"* anytime to turn it off.
56
+
57
+ ---
31
58
 
32
- **Ambient** โ€” auto-plays when stress is detected:
33
- - Enable with: `"enable ambient mode"` in Claude Code
34
- - Requires headphones (binaural beats need stereo separation)
35
- - 30-minute cooldown between sessions
36
- - Say `"disable wellness"` to turn off
59
+ ## ๐Ÿ“ฑ Data Sources
37
60
 
38
- ## Data Sources
61
+ | Source | What You Get | How to Connect |
62
+ |--------|-------------|----------------|
63
+ | โŒš **Apple Watch** | HRV, HR, steps, sleep, respiratory | Install [DaoBrew Health Sync](https://testflight.apple.com/join/6XTNFvv5) on iPhone |
64
+ | ๐Ÿ’ **Oura Ring** | HRV, HR, sleep, readiness, temp | Say *"connect oura"* in your agent |
65
+ | ๐Ÿšถ **None** | Step count only (demo mode) | Works out of the box |
39
66
 
40
- | Source | Data | Setup |
41
- |--------|------|-------|
42
- | **Apple Watch** | HRV, HR, steps, sleep | Install [DaoBrew Health Sync](https://testflight.apple.com/join/6XTNFvv5) on iPhone |
43
- | **Oura Ring** | HRV, HR, sleep, readiness | Say `"connect oura"` in Claude Code |
67
+ ---
44
68
 
45
- Without a wearable, only step count is available (Earth/Spleen pattern only).
69
+ ## ๐ŸŽต The Five Sounds
46
70
 
47
- ## 9 Tools + 3 Prompts
71
+ Each stress pattern gets its own genre, breathing rate, and vibe:
48
72
 
49
- | Tool | Description |
73
+ | Pattern | When You Feel... | Genre | BPM | What It Does |
74
+ |---------|-----------------|-------|-----|-------------|
75
+ | ๐ŸŒฒ Wood | Tense, tight, clenching | Ambient Downtempo | 6 | Releases tension, restores flow |
76
+ | ๐Ÿ”ฅ Fire | Wired, restless, can't focus | Lo-fi Chill Jazz | 5 | Cools the mind, settles racing thoughts |
77
+ | ๐ŸŒ Earth | Sluggish, foggy, unmotivated | Acoustic Folk | 6 | Grounds and centers, wakes you up gently |
78
+ | โš”๏ธ Metal | Shallow breathing, constricted | Nature + Pads | 7 | Opens the chest, deepens your breath |
79
+ | ๐ŸŒŠ Water | Drained, depleted, running on empty | Drone Ambient | 5 | Deep rest, replenishes your reserves |
80
+
81
+ Every track layers a **4Hz theta binaural beat** (requires headphones) plus **breath-paced volume modulation** โ€” the music rises and falls to gently guide your breathing.
82
+
83
+ > ๐Ÿ’ก On your first session, the agent tells you: *"Breathe in as the music rises, out as it fades."* After that, your body remembers โ€” no voice prompts, just music.
84
+
85
+ ---
86
+
87
+ ## ๐Ÿ›  9 Tools
88
+
89
+ | Tool | What It Does |
50
90
  |------|-------------|
51
- | `daobrew_get_wellness_state` | Current Yin/Yang balance + Five Element stress scores |
52
- | `daobrew_get_element_detail` | Deep-dive evidence for a specific stress pattern |
53
- | `daobrew_start_breathing_session` | Start guided breathing with audio playback |
54
- | `daobrew_get_session_result` | Post-session HRV improvement metrics |
55
- | `daobrew_get_session_history` | Recent session history and trends |
56
- | `daobrew_stop_session` | Stop current breathing session |
57
- | `daobrew_status` | Server mode, headphones, preferences, active session |
58
- | `daobrew_set_monitoring` | Configure ambient mode, volume, cooldown |
59
- | `daobrew_connect_source` | Connect Oura Ring or Apple Watch |
60
-
61
- ## How it works
91
+ | `daobrew_get_wellness_state` | Yin/Yang balance + Five Element stress scores |
92
+ | `daobrew_get_element_detail` | Evidence breakdown for a specific pattern |
93
+ | `daobrew_start_breathing_session` | Start session with audio/text |
94
+ | `daobrew_get_session_result` | Post-session HRV changes |
95
+ | `daobrew_get_session_history` | Recent sessions and trends |
96
+ | `daobrew_stop_session` | Stop current session |
97
+ | `daobrew_status` | Server mode, headphones, preferences |
98
+ | `daobrew_set_monitoring` | Configure ambient, volume, cooldown |
99
+ | `daobrew_connect_source` | Connect Apple Watch or Oura Ring |
100
+
101
+ ---
102
+
103
+ ## ๐Ÿ”’ Privacy
104
+
105
+ - Agent only sees **wellness scores** โ€” never raw health records
106
+ - Health tokens stored locally at `~/.daobrew/`
107
+ - Speaker blocklist prevents accidental playback without headphones
108
+ - Ambient mode requires explicit opt-in
109
+
110
+ ---
111
+
112
+ ## ๐Ÿ— Architecture
62
113
 
63
114
  ```
64
- Apple Watch / Oura
65
- โ†“
66
- DaoBrew Backend (Gemini LLM + TCM scoring)
67
- โ†“
68
- MCP Server (local, TypeScript)
69
- โ†“
70
- Claude Code โ†โ†’ afplay/mpv (binaural + breath modulation)
115
+ โŒš Apple Watch โ”€โ”€โ†’ iPhone SDK โ”€โ”€โ†’ DaoBrew Cloud โ”€โ”€โ†’ TCM Scoring Engine
116
+ ๐Ÿ’ Oura Ring โ”€โ”€โ”€โ”€โ†’ OAuth API โ”€โ”€โ†— โ†“
117
+ MCP Server (local)
118
+ โ†“
119
+ Your Coding Agent
120
+ โ†“
121
+ afplay / mpv ๐ŸŽง
122
+ (binaural + breath modulation)
71
123
  ```
72
124
 
73
- ## Privacy
125
+ ---
74
126
 
75
- - Only scored wellness data โ€” no raw health records in agent context
76
- - Health data stored locally (`~/.daobrew/`)
77
- - Headphone detection prevents accidental speaker playback
78
- - Ambient mode requires explicit opt-in
127
+ ## โš™๏ธ Configuration
79
128
 
80
- ## Configuration
129
+ Talk to your agent:
130
+ - *"set volume to 0.5"*
131
+ - *"change cooldown to 15 minutes"*
132
+ - *"trust headphones"* (skip detection)
133
+ - *"disable wellness"*
81
134
 
82
- Change settings in Claude Code: `"set volume to 0.5"`, `"change cooldown to 15 minutes"`, `"disable wellness"`
135
+ Or edit `~/.daobrew/prefs.json`.
83
136
 
84
- Or edit `~/.daobrew/prefs.json` directly.
137
+ ---
85
138
 
86
- ## Development
139
+ ## ๐Ÿง‘โ€๐Ÿ’ป Development
87
140
 
88
141
  ```bash
142
+ git clone <repo>
89
143
  cd daobrew-wellness-mcp
90
- npm install
91
- npm run build
144
+ npm install && npm run build
92
145
  npm test # 74 tests
93
146
  npm run setup # interactive setup
94
147
  ```
95
148
 
96
- ## License
149
+ ---
150
+
151
+ ## ๐Ÿ“œ License
97
152
 
98
153
  MIT
154
+
155
+ ---
156
+
157
+ *Built with ๐Ÿต by [DaoBrew](https://daobrew.com).*
158
+ *Take a breath. Your code can wait.*
@@ -19,4 +19,8 @@ export declare class DaoBrewClient {
19
19
  samples_received: number;
20
20
  message: string;
21
21
  }>;
22
+ createPairingCode(): Promise<{
23
+ code: string;
24
+ expires_in_seconds: number;
25
+ }>;
22
26
  }
@@ -61,5 +61,10 @@ class DaoBrewClient {
61
61
  body: JSON.stringify({ samples }),
62
62
  });
63
63
  }
64
+ async createPairingCode() {
65
+ return this.request("/pair/create", {
66
+ method: "POST",
67
+ });
68
+ }
64
69
  }
65
70
  exports.DaoBrewClient = DaoBrewClient;
package/dist/src/tools.js CHANGED
@@ -373,10 +373,27 @@ async function handleToolCall(name, args, isMock, _apiKey, isDemo = false, clien
373
373
  case "daobrew_connect_source": {
374
374
  const source = args.source;
375
375
  if (source === "apple_watch") {
376
+ // Generate pairing code if connected to real backend
377
+ if (!isMock && client) {
378
+ try {
379
+ const pairing = await client.createPairingCode();
380
+ return {
381
+ status: "pairing_started",
382
+ source: "apple_watch",
383
+ pairing_code: pairing.code,
384
+ expires_in_seconds: pairing.expires_in_seconds,
385
+ install_url: "https://testflight.apple.com/join/6XTNFvv5",
386
+ instructions: `1. Install DaoBrew Health Sync on your iPhone (TestFlight link above)\n2. Open the app and tap "Pair with Claude Code"\n3. Enter code: ${pairing.code}\n4. Grant HealthKit permissions when prompted\n5. Health data will sync automatically within 1-2 minutes`,
387
+ };
388
+ }
389
+ catch {
390
+ // Fall through to static response if backend unavailable
391
+ }
392
+ }
376
393
  return {
377
394
  status: "install_required",
378
395
  source: "apple_watch",
379
- install_url: "https://daobrew.com/health-sync",
396
+ install_url: "https://testflight.apple.com/join/6XTNFvv5",
380
397
  instructions: "Install DaoBrew Health Sync on your iPhone via TestFlight. It reads your Apple Watch data and syncs it to DaoBrew.",
381
398
  };
382
399
  }
package/package.json CHANGED
@@ -1,13 +1,19 @@
1
1
  {
2
2
  "name": "@daobrew/wellness-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Wellness MCP server โ€” biometric stress detection & recovery for AI agents",
5
5
  "main": "dist/src/index.js",
6
6
  "bin": {
7
7
  "daobrew-wellness-mcp": "dist/src/index.js",
8
8
  "daobrew-wellness-setup": "dist/src/setup-cli.js"
9
9
  },
10
- "files": ["dist/", "audio/", "SKILL.md", "README.md", "src/setup-cli.js"],
10
+ "files": [
11
+ "dist/",
12
+ "audio/",
13
+ "SKILL.md",
14
+ "README.md",
15
+ "src/setup-cli.js"
16
+ ],
11
17
  "scripts": {
12
18
  "build": "tsc",
13
19
  "setup": "node dist/src/setup-cli.js",
@@ -16,7 +22,15 @@
16
22
  "postinstall": "echo '\\n Run: npx daobrew-wellness-setup\\n to complete DaoBrew configuration.\\n'",
17
23
  "test": "node --test --test-concurrency=1 dist/tests/mock.test.js dist/tests/preferences.test.js dist/tests/headphones.test.js dist/tests/session.test.js dist/tests/cooldown.test.js dist/tests/cache.test.js dist/tests/e2e.test.js dist/tests/audio.test.js dist/tests/guards.test.js dist/tests/client.test.js dist/tests/sync.test.js"
18
24
  },
19
- "keywords": ["mcp", "wellness", "health", "biometrics", "tcm", "stress", "breathing"],
25
+ "keywords": [
26
+ "mcp",
27
+ "wellness",
28
+ "health",
29
+ "biometrics",
30
+ "tcm",
31
+ "stress",
32
+ "breathing"
33
+ ],
20
34
  "license": "MIT",
21
35
  "dependencies": {
22
36
  "@modelcontextprotocol/sdk": "^1.29.0"