tether-mcp 0.1.0__tar.gz
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.
- tether_mcp-0.1.0/LICENSE +21 -0
- tether_mcp-0.1.0/PKG-INFO +178 -0
- tether_mcp-0.1.0/README.md +121 -0
- tether_mcp-0.1.0/pyproject.toml +71 -0
- tether_mcp-0.1.0/setup.cfg +4 -0
- tether_mcp-0.1.0/src/tether_mcp.egg-info/PKG-INFO +178 -0
- tether_mcp-0.1.0/src/tether_mcp.egg-info/SOURCES.txt +23 -0
- tether_mcp-0.1.0/src/tether_mcp.egg-info/dependency_links.txt +1 -0
- tether_mcp-0.1.0/src/tether_mcp.egg-info/entry_points.txt +3 -0
- tether_mcp-0.1.0/src/tether_mcp.egg-info/requires.txt +12 -0
- tether_mcp-0.1.0/src/tether_mcp.egg-info/top_level.txt +1 -0
- tether_mcp-0.1.0/src/tether_mcp_local/__init__.py +5 -0
- tether_mcp-0.1.0/src/tether_mcp_local/cache.py +157 -0
- tether_mcp-0.1.0/src/tether_mcp_local/cli.py +613 -0
- tether_mcp-0.1.0/src/tether_mcp_local/client.py +100 -0
- tether_mcp-0.1.0/src/tether_mcp_local/crypto.py +236 -0
- tether_mcp-0.1.0/src/tether_mcp_local/mcp_server.py +338 -0
- tether_mcp-0.1.0/src/tether_mcp_local/service.py +1928 -0
- tether_mcp-0.1.0/src/tether_mcp_local/store.py +287 -0
- tether_mcp-0.1.0/tests/test_cache.py +252 -0
- tether_mcp-0.1.0/tests/test_cli.py +216 -0
- tether_mcp-0.1.0/tests/test_crypto.py +446 -0
- tether_mcp-0.1.0/tests/test_mcp_server.py +217 -0
- tether_mcp-0.1.0/tests/test_service.py +788 -0
- tether_mcp-0.1.0/tests/test_store.py +177 -0
tether_mcp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fino-wind (Tether — AI Health Sync)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tether-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local MCP server for Tether — AI Health Sync: your AI agent reads your end-to-end-encrypted Apple Health data (sleep, cycle, weight, water), decrypted only on your machine
|
|
5
|
+
Author: Fino-wind
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Fino-wind (Tether — AI Health Sync)
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://tetherme.app
|
|
29
|
+
Project-URL: Documentation, https://tetherme.app/mcp
|
|
30
|
+
Project-URL: Repository, https://github.com/Fino-wind/tether-mcp
|
|
31
|
+
Project-URL: Issues, https://github.com/Fino-wind/tether-community/issues
|
|
32
|
+
Project-URL: App Store, https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985
|
|
33
|
+
Keywords: mcp,model-context-protocol,apple-health,healthkit,e2ee,claude,ai-agent,sleep,health
|
|
34
|
+
Classifier: Development Status :: 4 - Beta
|
|
35
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
37
|
+
Classifier: Operating System :: OS Independent
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
42
|
+
Classifier: Topic :: Security :: Cryptography
|
|
43
|
+
Requires-Python: >=3.11
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: cryptography<47.0.0,>=42.0.0
|
|
47
|
+
Requires-Dist: httpx<1.0.0,>=0.28.0
|
|
48
|
+
Requires-Dist: keyring>=24
|
|
49
|
+
Requires-Dist: mcp<2.0.0,>=1.13.0
|
|
50
|
+
Provides-Extra: dev
|
|
51
|
+
Requires-Dist: pytest<9.0.0,>=8.3.0; extra == "dev"
|
|
52
|
+
Requires-Dist: ruff<1.0.0,>=0.11.0; extra == "dev"
|
|
53
|
+
Requires-Dist: mypy<2.0.0,>=1.13.0; extra == "dev"
|
|
54
|
+
Provides-Extra: qr
|
|
55
|
+
Requires-Dist: qrcode<9.0.0,>=8.0.0; extra == "qr"
|
|
56
|
+
Dynamic: license-file
|
|
57
|
+
|
|
58
|
+
# Tether MCP Server
|
|
59
|
+
|
|
60
|
+
**Let your own AI agent read your health data — without the cloud ever seeing it.**
|
|
61
|
+
|
|
62
|
+
This is the official local [MCP](https://modelcontextprotocol.io) server for [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985), the iOS app that syncs Apple Health data (sleep, heart rate, menstrual cycle, weight, water, symptoms) between partners and to your own AI — end-to-end encrypted.
|
|
63
|
+
|
|
64
|
+
Tether embeds no AI and runs no model on your phone. Intelligence lives where you control it: Claude Code, Claude Desktop, or any MCP-capable agent running on your own machine. This server is the bridge — it holds a private key that never leaves your computer, pulls ciphertext from the cloud, and decrypts **only locally**.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
iPhone (Apple Health) ──E2EE──▶ cloud (ciphertext only) ──E2EE──▶ this server (your machine) ──▶ your AI agent
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Requirements
|
|
71
|
+
|
|
72
|
+
- [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985) on iOS, with a **Pro** subscription (the AI-agent interface is the Pro tier)
|
|
73
|
+
- Python 3.11+ on the machine where your agent runs (macOS / Linux / Windows)
|
|
74
|
+
|
|
75
|
+
## Quick start
|
|
76
|
+
|
|
77
|
+
### 1. Install
|
|
78
|
+
|
|
79
|
+
With [uv](https://docs.astral.sh/uv/) (recommended — no clone needed):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp status
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or with pip:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install 'tether-mcp[qr] @ git+https://github.com/Fino-wind/tether-mcp'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 2. Bind your phone
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
tether-mcp bind
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This generates a keypair on your machine and prints a QR code. In the Tether iOS app, open **Settings → Data & AI → MCP Server** and scan it (or import a QR screenshot from Photos). The app authorizes this machine and starts sealing your health envelopes to its public key. The private key stays in `~/.tether/mcp-local/` (owner-only `0600` permissions, OS keychain where available) — it is never uploaded anywhere.
|
|
98
|
+
|
|
99
|
+
### 3. Connect your agent
|
|
100
|
+
|
|
101
|
+
**Claude Code** (one line):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
claude mcp add tether-health -- uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp serve --transport stdio
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Claude Desktop** (`claude_desktop_config.json`):
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"mcpServers": {
|
|
112
|
+
"tether-health": {
|
|
113
|
+
"command": "uvx",
|
|
114
|
+
"args": ["--from", "git+https://github.com/Fino-wind/tether-mcp", "tether-mcp", "serve", "--transport", "stdio"]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Any other MCP client: run `tether-mcp serve --transport stdio`, or `serve --transport http` for a loopback streamable-HTTP endpoint with bearer-token auth.
|
|
121
|
+
|
|
122
|
+
> **Claude Desktop note**: it does not inherit your shell `PATH`. If `uvx` isn't found, use the absolute path (`which uvx`) as `command`.
|
|
123
|
+
|
|
124
|
+
Debugging: `npx @modelcontextprotocol/inspector uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp serve --transport stdio`
|
|
125
|
+
|
|
126
|
+
Then just ask your agent: *“How did we sleep last night?”*
|
|
127
|
+
|
|
128
|
+
## MCP tools (16)
|
|
129
|
+
|
|
130
|
+
| Tool | Returns |
|
|
131
|
+
|---|---|
|
|
132
|
+
| `tether_status` | Local binding state (never exposes keys or tokens) |
|
|
133
|
+
| `tether_start_binding` | A fresh QR binding payload for the iOS app to scan |
|
|
134
|
+
| `tether_poll_binding` | One poll for the iOS authorization to complete binding |
|
|
135
|
+
| `tether_sync_sleep` | Recent sleep sessions incl. heart-rate samples, per-day primary-session selection matching the iOS app |
|
|
136
|
+
| `get_sleep_detail` | Per-night heart-rate + respiratory-rate + sleep-stage timeline |
|
|
137
|
+
| `get_water_intake` | Daily water intake + computed daily average |
|
|
138
|
+
| `get_weight_trend` | Daily weights + latest/avg/min/max + weekly trend rate |
|
|
139
|
+
| `get_menstrual_cycle` | Cycle samples + next-period prediction *(sensitive — explicit iOS opt-in required)* |
|
|
140
|
+
| `get_symptoms` | HealthKit symptom days grouped by data owner *(sensitive)* |
|
|
141
|
+
| `get_notes` | Free-text day annotations with their writer *(sensitive)* |
|
|
142
|
+
| `get_activity` | Daily activity rings: steps / energy / exercise minutes / stand hours / distance |
|
|
143
|
+
| `get_resting_hr` | Resting heart-rate records + window mean |
|
|
144
|
+
| `get_workouts` | Workout records: type / duration / calories / distance |
|
|
145
|
+
| `get_mindfulness` | Mindful sessions and minutes per day |
|
|
146
|
+
| `get_hrv` | Heart-rate variability (SDNN) records + window mean |
|
|
147
|
+
| `get_wrist_temp` | Sleeping wrist-temperature baseline deviation |
|
|
148
|
+
|
|
149
|
+
Every data tool accepts `owner` (a user-ID prefix) to filter to one person — the server may hold both your and your partner's shared records, and omitting `owner` mixes them into one pool, so per-person questions should always pass it. (Earlier releases named some tools `get_partner_*`; they were renamed in the 16-tool release since they return whichever owners' records this server holds, not specifically the partner's.)
|
|
150
|
+
|
|
151
|
+
Reads are cache-first: decrypted records are cached locally (owner-only files, 600 s TTL, `TETHER_MCP_CACHE_TTL` to override) so repeat queries answer in ~0.2 s with zero network; pass `fresh=true` to force a cloud round trip. The same service layer backs a full CLI (`tether-mcp sleep / water / weight / …` — every data subcommand takes `--owner` too) if you prefer scripts over MCP.
|
|
152
|
+
|
|
153
|
+
## Privacy & security model
|
|
154
|
+
|
|
155
|
+
- **End-to-end encryption**: Curve25519 ECDH + HKDF-SHA256 + AES-GCM. Every health record is sealed on-device to each authorized recipient's public key (your partner, and this server once bound).
|
|
156
|
+
- **The cloud only ever holds ciphertext.** Tether's backend cannot read your health data — architecturally, not just by policy.
|
|
157
|
+
- **Decryption happens here**, on hardware you own. The private key and server token are never exposed through any tool result.
|
|
158
|
+
- **Sensitive kinds** (menstrual cycle, symptoms, notes) reach this server only if explicitly opted in inside the iOS app, and are never re-exported by the server.
|
|
159
|
+
- HTTP transport binds to loopback by default and requires a bearer token; binding a non-loopback address fails closed unless explicitly allowed — front it with TLS if you must expose it.
|
|
160
|
+
|
|
161
|
+
You can audit all of the above in this repository — that is why it is open source.
|
|
162
|
+
|
|
163
|
+
## Development
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
pip install -e '.[dev,qr]'
|
|
167
|
+
pytest
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
[MIT](LICENSE). The Tether iOS app and cloud service are separate proprietary components; this repository covers the local MCP server only.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
*Website: [tetherme.app](https://tetherme.app) · App Store: [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985) · Bugs & feedback: [tether-community](https://github.com/Fino-wind/tether-community/issues)*
|
|
177
|
+
|
|
178
|
+
<!-- mcp-name: io.github.fino-wind/tether -->
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Tether MCP Server
|
|
2
|
+
|
|
3
|
+
**Let your own AI agent read your health data — without the cloud ever seeing it.**
|
|
4
|
+
|
|
5
|
+
This is the official local [MCP](https://modelcontextprotocol.io) server for [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985), the iOS app that syncs Apple Health data (sleep, heart rate, menstrual cycle, weight, water, symptoms) between partners and to your own AI — end-to-end encrypted.
|
|
6
|
+
|
|
7
|
+
Tether embeds no AI and runs no model on your phone. Intelligence lives where you control it: Claude Code, Claude Desktop, or any MCP-capable agent running on your own machine. This server is the bridge — it holds a private key that never leaves your computer, pulls ciphertext from the cloud, and decrypts **only locally**.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
iPhone (Apple Health) ──E2EE──▶ cloud (ciphertext only) ──E2EE──▶ this server (your machine) ──▶ your AI agent
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985) on iOS, with a **Pro** subscription (the AI-agent interface is the Pro tier)
|
|
16
|
+
- Python 3.11+ on the machine where your agent runs (macOS / Linux / Windows)
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
### 1. Install
|
|
21
|
+
|
|
22
|
+
With [uv](https://docs.astral.sh/uv/) (recommended — no clone needed):
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp status
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or with pip:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install 'tether-mcp[qr] @ git+https://github.com/Fino-wind/tether-mcp'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2. Bind your phone
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
tether-mcp bind
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
This generates a keypair on your machine and prints a QR code. In the Tether iOS app, open **Settings → Data & AI → MCP Server** and scan it (or import a QR screenshot from Photos). The app authorizes this machine and starts sealing your health envelopes to its public key. The private key stays in `~/.tether/mcp-local/` (owner-only `0600` permissions, OS keychain where available) — it is never uploaded anywhere.
|
|
41
|
+
|
|
42
|
+
### 3. Connect your agent
|
|
43
|
+
|
|
44
|
+
**Claude Code** (one line):
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
claude mcp add tether-health -- uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp serve --transport stdio
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Claude Desktop** (`claude_desktop_config.json`):
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"tether-health": {
|
|
56
|
+
"command": "uvx",
|
|
57
|
+
"args": ["--from", "git+https://github.com/Fino-wind/tether-mcp", "tether-mcp", "serve", "--transport", "stdio"]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Any other MCP client: run `tether-mcp serve --transport stdio`, or `serve --transport http` for a loopback streamable-HTTP endpoint with bearer-token auth.
|
|
64
|
+
|
|
65
|
+
> **Claude Desktop note**: it does not inherit your shell `PATH`. If `uvx` isn't found, use the absolute path (`which uvx`) as `command`.
|
|
66
|
+
|
|
67
|
+
Debugging: `npx @modelcontextprotocol/inspector uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp serve --transport stdio`
|
|
68
|
+
|
|
69
|
+
Then just ask your agent: *“How did we sleep last night?”*
|
|
70
|
+
|
|
71
|
+
## MCP tools (16)
|
|
72
|
+
|
|
73
|
+
| Tool | Returns |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `tether_status` | Local binding state (never exposes keys or tokens) |
|
|
76
|
+
| `tether_start_binding` | A fresh QR binding payload for the iOS app to scan |
|
|
77
|
+
| `tether_poll_binding` | One poll for the iOS authorization to complete binding |
|
|
78
|
+
| `tether_sync_sleep` | Recent sleep sessions incl. heart-rate samples, per-day primary-session selection matching the iOS app |
|
|
79
|
+
| `get_sleep_detail` | Per-night heart-rate + respiratory-rate + sleep-stage timeline |
|
|
80
|
+
| `get_water_intake` | Daily water intake + computed daily average |
|
|
81
|
+
| `get_weight_trend` | Daily weights + latest/avg/min/max + weekly trend rate |
|
|
82
|
+
| `get_menstrual_cycle` | Cycle samples + next-period prediction *(sensitive — explicit iOS opt-in required)* |
|
|
83
|
+
| `get_symptoms` | HealthKit symptom days grouped by data owner *(sensitive)* |
|
|
84
|
+
| `get_notes` | Free-text day annotations with their writer *(sensitive)* |
|
|
85
|
+
| `get_activity` | Daily activity rings: steps / energy / exercise minutes / stand hours / distance |
|
|
86
|
+
| `get_resting_hr` | Resting heart-rate records + window mean |
|
|
87
|
+
| `get_workouts` | Workout records: type / duration / calories / distance |
|
|
88
|
+
| `get_mindfulness` | Mindful sessions and minutes per day |
|
|
89
|
+
| `get_hrv` | Heart-rate variability (SDNN) records + window mean |
|
|
90
|
+
| `get_wrist_temp` | Sleeping wrist-temperature baseline deviation |
|
|
91
|
+
|
|
92
|
+
Every data tool accepts `owner` (a user-ID prefix) to filter to one person — the server may hold both your and your partner's shared records, and omitting `owner` mixes them into one pool, so per-person questions should always pass it. (Earlier releases named some tools `get_partner_*`; they were renamed in the 16-tool release since they return whichever owners' records this server holds, not specifically the partner's.)
|
|
93
|
+
|
|
94
|
+
Reads are cache-first: decrypted records are cached locally (owner-only files, 600 s TTL, `TETHER_MCP_CACHE_TTL` to override) so repeat queries answer in ~0.2 s with zero network; pass `fresh=true` to force a cloud round trip. The same service layer backs a full CLI (`tether-mcp sleep / water / weight / …` — every data subcommand takes `--owner` too) if you prefer scripts over MCP.
|
|
95
|
+
|
|
96
|
+
## Privacy & security model
|
|
97
|
+
|
|
98
|
+
- **End-to-end encryption**: Curve25519 ECDH + HKDF-SHA256 + AES-GCM. Every health record is sealed on-device to each authorized recipient's public key (your partner, and this server once bound).
|
|
99
|
+
- **The cloud only ever holds ciphertext.** Tether's backend cannot read your health data — architecturally, not just by policy.
|
|
100
|
+
- **Decryption happens here**, on hardware you own. The private key and server token are never exposed through any tool result.
|
|
101
|
+
- **Sensitive kinds** (menstrual cycle, symptoms, notes) reach this server only if explicitly opted in inside the iOS app, and are never re-exported by the server.
|
|
102
|
+
- HTTP transport binds to loopback by default and requires a bearer token; binding a non-loopback address fails closed unless explicitly allowed — front it with TLS if you must expose it.
|
|
103
|
+
|
|
104
|
+
You can audit all of the above in this repository — that is why it is open source.
|
|
105
|
+
|
|
106
|
+
## Development
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pip install -e '.[dev,qr]'
|
|
110
|
+
pytest
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
[MIT](LICENSE). The Tether iOS app and cloud service are separate proprietary components; this repository covers the local MCP server only.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
*Website: [tetherme.app](https://tetherme.app) · App Store: [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985) · Bugs & feedback: [tether-community](https://github.com/Fino-wind/tether-community/issues)*
|
|
120
|
+
|
|
121
|
+
<!-- mcp-name: io.github.fino-wind/tether -->
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tether-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Local MCP server for Tether — AI Health Sync: your AI agent reads your end-to-end-encrypted Apple Health data (sleep, cycle, weight, water), decrypted only on your machine"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
authors = [{ name = "Fino-wind" }]
|
|
12
|
+
keywords = ["mcp", "model-context-protocol", "apple-health", "healthkit", "e2ee", "claude", "ai-agent", "sleep", "health"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Intended Audience :: End Users/Desktop",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
22
|
+
"Topic :: Security :: Cryptography",
|
|
23
|
+
]
|
|
24
|
+
requires-python = ">=3.11"
|
|
25
|
+
dependencies = [
|
|
26
|
+
"cryptography>=42.0.0,<47.0.0",
|
|
27
|
+
"httpx>=0.28.0,<1.0.0",
|
|
28
|
+
"keyring>=24",
|
|
29
|
+
"mcp>=1.13.0,<2.0.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://tetherme.app"
|
|
34
|
+
Documentation = "https://tetherme.app/mcp"
|
|
35
|
+
Repository = "https://github.com/Fino-wind/tether-mcp"
|
|
36
|
+
Issues = "https://github.com/Fino-wind/tether-community/issues"
|
|
37
|
+
"App Store" = "https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985"
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
dev = [
|
|
41
|
+
"pytest>=8.3.0,<9.0.0",
|
|
42
|
+
"ruff>=0.11.0,<1.0.0",
|
|
43
|
+
"mypy>=1.13.0,<2.0.0",
|
|
44
|
+
]
|
|
45
|
+
qr = [
|
|
46
|
+
"qrcode>=8.0.0,<9.0.0",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
tether-mcp = "tether_mcp_local.cli:main"
|
|
51
|
+
# Back-compat alias for the original internal name.
|
|
52
|
+
tether-mcp-local = "tether_mcp_local.cli:main"
|
|
53
|
+
|
|
54
|
+
[tool.pytest.ini_options]
|
|
55
|
+
# src-layout: make tether_mcp_local importable for the test run without depending
|
|
56
|
+
# on an editable install being present. The editable .pth can silently drop out
|
|
57
|
+
# when the venv is rebuilt (e.g. via `uv sync`), which otherwise breaks collection.
|
|
58
|
+
pythonpath = ["src"]
|
|
59
|
+
|
|
60
|
+
[tool.ruff]
|
|
61
|
+
line-length = 100
|
|
62
|
+
target-version = "py311"
|
|
63
|
+
|
|
64
|
+
[tool.mypy]
|
|
65
|
+
python_version = "3.11"
|
|
66
|
+
check_untyped_defs = true
|
|
67
|
+
warn_unused_ignores = true
|
|
68
|
+
warn_return_any = true
|
|
69
|
+
|
|
70
|
+
[tool.setuptools.packages.find]
|
|
71
|
+
where = ["src"]
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tether-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local MCP server for Tether — AI Health Sync: your AI agent reads your end-to-end-encrypted Apple Health data (sleep, cycle, weight, water), decrypted only on your machine
|
|
5
|
+
Author: Fino-wind
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Fino-wind (Tether — AI Health Sync)
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://tetherme.app
|
|
29
|
+
Project-URL: Documentation, https://tetherme.app/mcp
|
|
30
|
+
Project-URL: Repository, https://github.com/Fino-wind/tether-mcp
|
|
31
|
+
Project-URL: Issues, https://github.com/Fino-wind/tether-community/issues
|
|
32
|
+
Project-URL: App Store, https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985
|
|
33
|
+
Keywords: mcp,model-context-protocol,apple-health,healthkit,e2ee,claude,ai-agent,sleep,health
|
|
34
|
+
Classifier: Development Status :: 4 - Beta
|
|
35
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
37
|
+
Classifier: Operating System :: OS Independent
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
42
|
+
Classifier: Topic :: Security :: Cryptography
|
|
43
|
+
Requires-Python: >=3.11
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: cryptography<47.0.0,>=42.0.0
|
|
47
|
+
Requires-Dist: httpx<1.0.0,>=0.28.0
|
|
48
|
+
Requires-Dist: keyring>=24
|
|
49
|
+
Requires-Dist: mcp<2.0.0,>=1.13.0
|
|
50
|
+
Provides-Extra: dev
|
|
51
|
+
Requires-Dist: pytest<9.0.0,>=8.3.0; extra == "dev"
|
|
52
|
+
Requires-Dist: ruff<1.0.0,>=0.11.0; extra == "dev"
|
|
53
|
+
Requires-Dist: mypy<2.0.0,>=1.13.0; extra == "dev"
|
|
54
|
+
Provides-Extra: qr
|
|
55
|
+
Requires-Dist: qrcode<9.0.0,>=8.0.0; extra == "qr"
|
|
56
|
+
Dynamic: license-file
|
|
57
|
+
|
|
58
|
+
# Tether MCP Server
|
|
59
|
+
|
|
60
|
+
**Let your own AI agent read your health data — without the cloud ever seeing it.**
|
|
61
|
+
|
|
62
|
+
This is the official local [MCP](https://modelcontextprotocol.io) server for [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985), the iOS app that syncs Apple Health data (sleep, heart rate, menstrual cycle, weight, water, symptoms) between partners and to your own AI — end-to-end encrypted.
|
|
63
|
+
|
|
64
|
+
Tether embeds no AI and runs no model on your phone. Intelligence lives where you control it: Claude Code, Claude Desktop, or any MCP-capable agent running on your own machine. This server is the bridge — it holds a private key that never leaves your computer, pulls ciphertext from the cloud, and decrypts **only locally**.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
iPhone (Apple Health) ──E2EE──▶ cloud (ciphertext only) ──E2EE──▶ this server (your machine) ──▶ your AI agent
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Requirements
|
|
71
|
+
|
|
72
|
+
- [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985) on iOS, with a **Pro** subscription (the AI-agent interface is the Pro tier)
|
|
73
|
+
- Python 3.11+ on the machine where your agent runs (macOS / Linux / Windows)
|
|
74
|
+
|
|
75
|
+
## Quick start
|
|
76
|
+
|
|
77
|
+
### 1. Install
|
|
78
|
+
|
|
79
|
+
With [uv](https://docs.astral.sh/uv/) (recommended — no clone needed):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp status
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or with pip:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install 'tether-mcp[qr] @ git+https://github.com/Fino-wind/tether-mcp'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 2. Bind your phone
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
tether-mcp bind
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This generates a keypair on your machine and prints a QR code. In the Tether iOS app, open **Settings → Data & AI → MCP Server** and scan it (or import a QR screenshot from Photos). The app authorizes this machine and starts sealing your health envelopes to its public key. The private key stays in `~/.tether/mcp-local/` (owner-only `0600` permissions, OS keychain where available) — it is never uploaded anywhere.
|
|
98
|
+
|
|
99
|
+
### 3. Connect your agent
|
|
100
|
+
|
|
101
|
+
**Claude Code** (one line):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
claude mcp add tether-health -- uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp serve --transport stdio
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Claude Desktop** (`claude_desktop_config.json`):
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"mcpServers": {
|
|
112
|
+
"tether-health": {
|
|
113
|
+
"command": "uvx",
|
|
114
|
+
"args": ["--from", "git+https://github.com/Fino-wind/tether-mcp", "tether-mcp", "serve", "--transport", "stdio"]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Any other MCP client: run `tether-mcp serve --transport stdio`, or `serve --transport http` for a loopback streamable-HTTP endpoint with bearer-token auth.
|
|
121
|
+
|
|
122
|
+
> **Claude Desktop note**: it does not inherit your shell `PATH`. If `uvx` isn't found, use the absolute path (`which uvx`) as `command`.
|
|
123
|
+
|
|
124
|
+
Debugging: `npx @modelcontextprotocol/inspector uvx --from 'git+https://github.com/Fino-wind/tether-mcp' tether-mcp serve --transport stdio`
|
|
125
|
+
|
|
126
|
+
Then just ask your agent: *“How did we sleep last night?”*
|
|
127
|
+
|
|
128
|
+
## MCP tools (16)
|
|
129
|
+
|
|
130
|
+
| Tool | Returns |
|
|
131
|
+
|---|---|
|
|
132
|
+
| `tether_status` | Local binding state (never exposes keys or tokens) |
|
|
133
|
+
| `tether_start_binding` | A fresh QR binding payload for the iOS app to scan |
|
|
134
|
+
| `tether_poll_binding` | One poll for the iOS authorization to complete binding |
|
|
135
|
+
| `tether_sync_sleep` | Recent sleep sessions incl. heart-rate samples, per-day primary-session selection matching the iOS app |
|
|
136
|
+
| `get_sleep_detail` | Per-night heart-rate + respiratory-rate + sleep-stage timeline |
|
|
137
|
+
| `get_water_intake` | Daily water intake + computed daily average |
|
|
138
|
+
| `get_weight_trend` | Daily weights + latest/avg/min/max + weekly trend rate |
|
|
139
|
+
| `get_menstrual_cycle` | Cycle samples + next-period prediction *(sensitive — explicit iOS opt-in required)* |
|
|
140
|
+
| `get_symptoms` | HealthKit symptom days grouped by data owner *(sensitive)* |
|
|
141
|
+
| `get_notes` | Free-text day annotations with their writer *(sensitive)* |
|
|
142
|
+
| `get_activity` | Daily activity rings: steps / energy / exercise minutes / stand hours / distance |
|
|
143
|
+
| `get_resting_hr` | Resting heart-rate records + window mean |
|
|
144
|
+
| `get_workouts` | Workout records: type / duration / calories / distance |
|
|
145
|
+
| `get_mindfulness` | Mindful sessions and minutes per day |
|
|
146
|
+
| `get_hrv` | Heart-rate variability (SDNN) records + window mean |
|
|
147
|
+
| `get_wrist_temp` | Sleeping wrist-temperature baseline deviation |
|
|
148
|
+
|
|
149
|
+
Every data tool accepts `owner` (a user-ID prefix) to filter to one person — the server may hold both your and your partner's shared records, and omitting `owner` mixes them into one pool, so per-person questions should always pass it. (Earlier releases named some tools `get_partner_*`; they were renamed in the 16-tool release since they return whichever owners' records this server holds, not specifically the partner's.)
|
|
150
|
+
|
|
151
|
+
Reads are cache-first: decrypted records are cached locally (owner-only files, 600 s TTL, `TETHER_MCP_CACHE_TTL` to override) so repeat queries answer in ~0.2 s with zero network; pass `fresh=true` to force a cloud round trip. The same service layer backs a full CLI (`tether-mcp sleep / water / weight / …` — every data subcommand takes `--owner` too) if you prefer scripts over MCP.
|
|
152
|
+
|
|
153
|
+
## Privacy & security model
|
|
154
|
+
|
|
155
|
+
- **End-to-end encryption**: Curve25519 ECDH + HKDF-SHA256 + AES-GCM. Every health record is sealed on-device to each authorized recipient's public key (your partner, and this server once bound).
|
|
156
|
+
- **The cloud only ever holds ciphertext.** Tether's backend cannot read your health data — architecturally, not just by policy.
|
|
157
|
+
- **Decryption happens here**, on hardware you own. The private key and server token are never exposed through any tool result.
|
|
158
|
+
- **Sensitive kinds** (menstrual cycle, symptoms, notes) reach this server only if explicitly opted in inside the iOS app, and are never re-exported by the server.
|
|
159
|
+
- HTTP transport binds to loopback by default and requires a bearer token; binding a non-loopback address fails closed unless explicitly allowed — front it with TLS if you must expose it.
|
|
160
|
+
|
|
161
|
+
You can audit all of the above in this repository — that is why it is open source.
|
|
162
|
+
|
|
163
|
+
## Development
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
pip install -e '.[dev,qr]'
|
|
167
|
+
pytest
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
[MIT](LICENSE). The Tether iOS app and cloud service are separate proprietary components; this repository covers the local MCP server only.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
*Website: [tetherme.app](https://tetherme.app) · App Store: [Tether — AI Health Sync](https://apps.apple.com/us/app/tether-ai-health-sync/id6759241985) · Bugs & feedback: [tether-community](https://github.com/Fino-wind/tether-community/issues)*
|
|
177
|
+
|
|
178
|
+
<!-- mcp-name: io.github.fino-wind/tether -->
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/tether_mcp.egg-info/PKG-INFO
|
|
5
|
+
src/tether_mcp.egg-info/SOURCES.txt
|
|
6
|
+
src/tether_mcp.egg-info/dependency_links.txt
|
|
7
|
+
src/tether_mcp.egg-info/entry_points.txt
|
|
8
|
+
src/tether_mcp.egg-info/requires.txt
|
|
9
|
+
src/tether_mcp.egg-info/top_level.txt
|
|
10
|
+
src/tether_mcp_local/__init__.py
|
|
11
|
+
src/tether_mcp_local/cache.py
|
|
12
|
+
src/tether_mcp_local/cli.py
|
|
13
|
+
src/tether_mcp_local/client.py
|
|
14
|
+
src/tether_mcp_local/crypto.py
|
|
15
|
+
src/tether_mcp_local/mcp_server.py
|
|
16
|
+
src/tether_mcp_local/service.py
|
|
17
|
+
src/tether_mcp_local/store.py
|
|
18
|
+
tests/test_cache.py
|
|
19
|
+
tests/test_cli.py
|
|
20
|
+
tests/test_crypto.py
|
|
21
|
+
tests/test_mcp_server.py
|
|
22
|
+
tests/test_service.py
|
|
23
|
+
tests/test_store.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tether_mcp_local
|