dot-iphone-mcp
by oxmumu3
README.md
# @oxmumu3/dot-iphone-mcp
Give **Claude Code**, **Codex**, **Cursor**, **Antigravity**, **DeepSeek Harness**, and **OpenClaw** real-time access to your iPhone (Calendar, Reminders, Alarms/Timers, Contacts, Health summary, Maps/Navigation, Shortcuts) plus **Lock Screen & Dynamic Island (`Live Activity`) approval cards** — powered by the official App Store **[DSH Dot](https://apps.apple.com)** app with zero external npm dependencies.
> **100% Local Bridge + Zero-Retention Push Relay**: All MCP calls stay on your Mac (`127.0.0.1` loopback + `Bearer` token), device tools stream directly between your Mac and paired iPhone over LAN / Tailscale / Cloudflared, and Lock Screen / Dynamic Island wakeup notifications go through a stateless open-source Cloudflare Worker relay ([`apns-relay/worker.mjs`](apns-relay/worker.mjs)) that stores zero user data and logs zero payloads.
---
## Quick Start
### 1. Install the iOS Companion App
Download **DSH Dot** from the Apple App Store (`v1.3.9+`) on your iPhone.
### 2. Start & Pair the Local Bridge on Mac
```bash
# Start the local bridge daemon (or install macOS auto-start LaunchAgent)
npx @oxmumu3/dot-iphone-mcp install-agent
# Print your 6-digit pairing PIN + QR banner
npx @oxmumu3/dot-iphone-mcp pair
```
Open **DSH Dot** on your iPhone -> **Pair / Connect** -> enter the 6-digit PIN shown in terminal (valid for 15 minutes).
### 3. Add `iphone` MCP Server to Your Agent
Run `npx @oxmumu3/dot-iphone-mcp setup` to print ready-to-paste snippets, or add manually:
**Claude Code / Cursor / Antigravity (`mcp_config.json`)**
```json
{
"mcpServers": {
"iphone": {
"command": "npx",
"args": ["-y", "@oxmumu3/dot-iphone-mcp"]
}
}
}
```
**Codex (`~/.codex/config.toml`)**
```toml
[mcp_servers.iphone]
command = "npx"
args = ["-y", "@oxmumu3/dot-iphone-mcp"]
```
---
## 13 Exposed MCP Tools
| Category | Tool Name | Safety Model | Description |
| --- | --- | --- | --- |
| Status | `iphone_status` | Read-only | Connectivity, paired device status, latency, APNs/LiveActivity readiness, active modules |
| Calendar | `iphone_calendar_list` | Direct read | Query iPhone calendar events inside an ISO date range |
| Calendar | `iphone_calendar_create` | Staged approval | Stage a new calendar event card on iPhone for user confirmation |
| Reminders | `iphone_reminders_list` | Direct read | Query open/completed iOS Reminders |
| Reminders | `iphone_reminder_create` | Staged approval | Stage a new reminder card on iPhone (`YYYY-MM-DD HH:mm` / ISO) |
| Alarms | `iphone_alarm_create` | Staged approval | Stage a countdown timer (`durationSeconds`) or AlarmKit wake-up (`fireIso`) |
| Health | `iphone_health_summary` | Direct read | Query today's steps, sleep, workouts, heart rate & active energy from HealthKit |
| Contacts | `iphone_contacts_search` | Direct read | Fuzzy search iPhone Contacts by name/phone/org |
| Maps | `iphone_maps_search_or_handoff` | Direct read | Search places or compute ETA + Apple Maps / Amap / Baidu / Google deep links |
| Shortcuts | `iphone_shortcuts_list_and_run` | Read / Staged | List iOS Shortcuts/recipes or stage a confirmation card to launch a Shortcut |
| Combo | `iphone_combo_plan` | Staged approval | Stage a multi-step morning/travel/focus card on iPhone |
| Approval | `iphone_request_approval` | Dynamic Island gate | Push an interactive Lock Screen / Live Activity approval card (`准奏` / `取消`) and wait up to 120s |
| Approval | `iphone_check_action` | Poll / Cancel | Check settlement state (`approved` / `cancelled` / `pending`) or cancel a card |
---
## Sentinel Security & Privacy Guarantees
1. **Loopback-Only MCP Endpoint**: `/api/mcp/device-call` rejects non-loopback sockets and any request carrying `X-Forwarded-For`, `CF-Connecting-IP`, or `Forwarded`.
2. **Read-Only Direct Execution Guard**: Even if someone attempts `op: "invoke"` for mutating iOS tools (`calendar.create`, `reminders.create`, `alarms.timer`, `shortcuts.run`, etc.), the server fails closed (`403 approval_required`) and requires interactive mobile confirmation.
3. **Secret Leakage Circuit Breaker**: [`lib/sentinel-guard.mjs`](lib/sentinel-guard.mjs) scans staged titles/summaries/fields/payloads for API keys (`sk-...`, `ghp_...`, `AKIA...`), PEM private keys, database URIs, OTP codes, and Luhn credit card numbers, rejecting with `400 SENTINEL_SECRET_BLOCKED` before anything leaves localhost.
4. **Notification Privacy (`APNs Relay`)**: By default, `@oxmumu3/dot-iphone-mcp` routes Lock Screen & iOS Live Activity pushes through the public stateless relay at `https://dot-apns-relay.dsh-plugin-finder.workers.dev` (16 KB body limit, IP/token rate limiting, zero storage, zero payload logging).
- **Disable relay completely**: `export DOT_APNS_RELAY_URL=off` (iPhone must stay in foreground/App to confirm).
- **Self-host your own relay / own iOS build**: Deploy [`apns-relay/worker.mjs`](apns-relay/worker.mjs) to your own Cloudflare Workers account and set `DOT_APNS_RELAY_URL`, or configure your own `.p8` via `DOT_APNS_KEY_PATH` + `DOT_APNS_KEY_ID`.
---
## CLI Subcommands
- `dot-iphone-mcp` — Start stdio JSON-RPC 2.0 MCP server (default when invoked without arguments)
- `dot-iphone-mcp serve` — Run the background HTTP/SSE Mac Bridge (`0.0.0.0:58471`)
- `dot-iphone-mcp pair [--rotate]` — Display/rotate the 6-digit pairing PIN and LAN URLs
- `dot-iphone-mcp doctor` — Check bridge daemon health, port, and tunnel readiness
- `dot-iphone-mcp setup` — Print copy-paste MCP client snippets
- `dot-iphone-mcp install-agent` / `uninstall-agent` — Manage the macOS LaunchAgent (`ai.dot.iphone-mcp`)
## License
[MIT](LICENSE)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues