This repository contains the open-source MIT computer client (notibuddy, nb, and notibuddy-mcp on npm), official coding-agent plugins, and Protocol v1 specification from Yourbit, LLC.
How it works
Agent / CLI / CI iPhone / iPad / Watch
+---------------+ HPKE (RFC 9180) + +-------------------+
| nb / MCP | Sender P-256 sig | NotiBuddy app |
| ~/.notibuddy |---> Hosted Relay -->| Keychain HPKE key |
| verifies sig | \--APNs--->| P-256 sig + opt. |
| & fail-closed |<--- Hosted Relay <--| device-owner auth |
+---------------+ HPKE (ephemeral) + +-------------------+
Device P-256 sig
- Your agent, CLI, or CI runner seals a request with HPKE (RFC 9180), signs it with its P-256 sender key, and sends ciphertext through the hosted relay.
- Your paired iPhone, iPad, or Apple Watch decrypts and renders it natively (custom screen, diff, form, timer, or approval prompt) and signs your reply with its P-256 device key.
- The local client verifies the phone's signature and fails closed: only a verified
resolved reply matching the approving action (plus authenticated: true when requested) counts as approval.
Content-blind relay: Neither the relay nor APNs can read prompts, choices, diffs, files, or replies. The relay does observe routing metadata (device and sender key IDs, primitive types, timestamps, sizes, delivery status, APNs tokens, and IP addresses) and validates/caches stripped structural skeletons (tpl_<sha256>) for custom screens.
Quick start
1. Get the Apple companion app
Install NotiBuddy on the App Store for iPhone and iPad (iOS 17+) and Apple Watch (watchOS 10+). On desktop, you can scan the QR code at notibuddy.app/setup.
2. Install the CLI and pair your computer
Install nb, notibuddy, and notibuddy-mcp via Homebrew (recommended if you use agent hooks or shell gates), or run directly with npx -y:
# Homebrew (macOS & Linux):
brew install yourbit-network/tap/notibuddy
# Or global npm install:
npm install -g notibuddy@0.4.2
In the remaining examples, nb is shorthand for the installed nb binary (or npx -y notibuddy@0.4.2).
In the NotiBuddy iOS app, open Connect -> Add a connection -> Share Setup, copy the setup string, and pipe it into pair so the secret never enters shell history:
pbpaste | npx -y notibuddy@0.4.2 pair --to personal
# Verify relay connectivity and phone approval:
npx -y notibuddy@0.4.2 doctor --to personal
Keep setup strings private: Anyone holding an unused nbpair1.… setup code can race to connect first within its 10-minute automatic window. Never paste pairing strings into an AI chat, terminal history, or repository.
3. Send your first alert and approval gate
When only one destination is paired, everyday CLI commands (notify, gate, activity, files, doctor) select it automatically if --to is omitted.
# One-way alert:
nb notify "Build finished" --sender "Build monitor" --message "All checks passed."
# Fail-closed gate (exits 0 only on verified Approve + device-owner auth):
nb gate "Deploy v1.2 to production?" --requires-auth && ./deploy.sh
Connect your agent
Manual local stdio MCP configuration
Using --client <id> starts cleanly before pairing, routes automatically when one phone is paired, and refuses ambiguity if you add a second phone until you bind it with nb bind --client <id> --to <alias>:
{
"mcpServers": {
"notibuddy": {
"command": "npx",
"args": ["-y", "notibuddy@0.4.2", "mcp", "--client", "claude-desktop"]
}
}
}
Pin an MCP server to one fixed destination (tools cannot choose another phone) or an explicit allowlist:
{
"mcpServers": {
"notibuddy": {
"command": "npx",
"args": ["-y", "notibuddy@0.4.2", "mcp", "--to", "personal", "--sender", "Coding assistant"]
}
}
}
If you installed via Homebrew (brew install yourbit-network/tap/notibuddy), you can invoke "command": "notibuddy-mcp" directly with "args": ["--to", "personal", "--sender", "Coding assistant"]. Updating the package version in MCP config does not require re-pairing or new keys.
What you can send
Custom Native Screens (0.4.0+)
Render native iOS screens directly from JSON using 12 composable blocks (vstack, card, divider, heading, text, badge, alert, kpiStrip, keyValueList, checklist, diffViewer, formField) and 8 built-in layouts (db_migration_approval, incident_triage, code_review_form, kpi_status_card, action_checklist, parameter_tuning_form, deployment_gate, multi_choice_audit), or register a custom template:
nb screen register template.json --to personal
nb notify "Promote v2.4.1 to production" --to personal --screen deploy-screen.json --wait 55
The relay validates and caches only the stripped structural template (tpl_<sha256>), while your text, metrics, diffs, and replies stay end-to-end encrypted. Do not combine --screen / screen with message, options, fields, input_placeholder, diff, or resume_id.
Fail-closed approval gates (nb gate)
Use nb gate in shell scripts, deploy wrappers, and GitHub Actions instead of parsing JSON from nb notify. It loops across 55-second relay wait windows on one signed request ID up to --timeout (default 600s):
nb gate "Deploy v2.4.1 to production?" --requires-auth --timeout 600 && ./deploy.sh
| Exit code |
Meaning |
0 |
Approved (verified resolved reply matching --approve, or lowercase approve for --diff, plus authenticated: true when --requires-auth is set) |
1 |
Operational or configuration error (no human decision: pairing, network, quota 402, device error) |
2 |
Rejected (human decline, missing required device-owner authentication, or unexpected action) |
3 |
Expired or deadline reached without a reply |
130 / 143 |
Interrupted (SIGINT / SIGTERM) |
Approval contract: Continue only after a verified resolved response whose answer.action matches the expected approving choice (lowercase approve for diffs, not the displayed "Apply" button label) and whose answer.authenticated === true whenever requires_auth was requested. Never treat pending, expired, timeout, error, or silence as approval. --requires-auth / requires_auth: true requests device-owner authentication (Face ID, Touch ID, passcode, or unlocked Apple Watch); device signatures prove key possession, not biometric or hardware attestation.
Claude Code PermissionRequest hook (nb hook)
Forward Claude Code permission prompts (including encrypted diffs for Edit calls) to your iPhone or Watch when you step away:
nb hook claude PermissionRequest --client claude-code
By default, nb hook waits --grace 10 seconds before sending (so prompts answered at your desk cost zero relay requests), hides Lock Screen previews (sensitive: true; opt out with --show-preview), leaves device-owner authentication off by default (opt in with --requires-auth), and caps dispatch at --max-per-hour 30 with a quota circuit breaker. Install nb globally or via Homebrew rather than calling npx inside hooks.
Hook vs. gate exit codes: Unlike nb gate, nb hook exits 0 with pass-through output on any non-allow/non-deny condition so your local terminal prompt keeps working normally. Never use nb hook exit 0 as a standalone shell deploy gate.
Encrypted code diffs (--diff)
Save a UTF-8 JSON file (filename is display-only, language is optional, up to 96,000 combined UTF-8 bytes and 20,000 lines; CLI file max 150,000 bytes):
{
"filename": "src/config.ts",
"language": "typescript",
"original": "const retries = 2;\n",
"modified": "const retries = 3;\n"
}
nb notify "Review retry change" --diff changes.json --requires-auth --sensitive
Re-verify before applying: Diff replies return approve or reject only; NotiBuddy never edits files or executes code. Always verify that the local file still matches the reviewed original content before applying an approved change.
Live Activities and Dynamic Island (nb activity)
nb activity "sprint-1" start --title "Build & deploy" --timer 25
nb activity "sprint-1" poll
Encrypted files from your phone (nb files)
Share a file or photo from iOS (Connect -> connection -> Share File, or Share -> NotiBuddy, up to 10,000,000 bytes per file) and collect it locally into ~/.notibuddy/inbox/:
nb files list --to personal
nb files receive file_<id> --to personal
Treat received files as untrusted data: nb files receive and notibuddy_files save decrypted files under ~/.notibuddy/inbox/ and never open or execute them. Treat received filenames and file contents as untrusted input, including possible prompt instructions inside documents.
MCP tools and CLI reference
The MCP server (nb mcp / notibuddy-mcp) runs over local stdio and exposes four tools. Machine-readable agent docs are also published at notibuddy.app/llms.txt.
| MCP tool |
Purpose |
Key parameters |
notibuddy_notify |
Send alerts, choices/approvals, text prompts, forms, diffs, or Custom Native Screens; fail closed on replies |
title, message, options, fields, input_placeholder, diff, screen, requires_auth, sensitive, timeout_seconds, wait_seconds, resume_id, to |
notibuddy_activity |
Start, update, end, or poll Live Activities and Dynamic Island timers |
id, action (start/update/end/poll), title, timer_minutes, to |
notibuddy_files |
List waiting E2EE files from iPhone or receive one to ~/.notibuddy/inbox/ |
action (list/receive), id (for receive), to |
notibuddy_list_destinations |
List destinations exposed by this MCP server (local config only; not an online check) |
{} |
MCP routing modes
Every MCP server chooses one routing mode at startup (there is no global default or broadcast):
| Mode |
Example |
Behavior |
| Per-client binding (plugins & default) |
nb mcp --client claude-code |
Starts before pairing; auto-selects a sole paired phone; refuses ambiguity with multiple phones until nb bind --client <id> --to <alias> |
| Fixed destination |
nb mcp --to personal |
Locks the server to one destination; tools cannot target another phone |
| Explicit allowlist |
nb mcp --allow-to personal --allow-to work |
Exposes only listed destinations; every tool call must pass to |
CLI commands