# NotiBuddy auth.md

NotiBuddy connects AI agents to a human's paired iPhone, iPad, or Apple Watch. By design, credentials cannot be self-provisioned anonymously: every connection requires explicit human-in-the-loop pairing on the user's Apple device.

## 1. Hosted Remote MCP (OAuth 2.1 + PKCE)

For remote MCP clients (ChatGPT, Claude, VS Code, Cursor, and other OAuth 2.1 MCP hosts):

- **MCP Endpoint:** `https://mcp.notibuddy.app/mcp`
- **OAuth Protected Resource Metadata (RFC 9728):** `https://mcp.notibuddy.app/.well-known/oauth-protected-resource`
- **OAuth Authorization Server Metadata (RFC 8414):** `https://mcp.notibuddy.app/.well-known/oauth-authorization-server`
- **Dynamic Client Registration (RFC 7591):** `https://mcp.notibuddy.app/oauth/register`
- **Authorization Endpoint:** `https://mcp.notibuddy.app/oauth/authorize` (PKCE `S256` required; user confirms pairing on iPhone)
- **Token Endpoint:** `https://mcp.notibuddy.app/oauth/token` (returns Bearer access token + rotating refresh token)
- **Revocation Endpoint:** `https://mcp.notibuddy.app/oauth/revoke`
- **Credential Use:** Send `Authorization: Bearer <access_token>` on `POST https://mcp.notibuddy.app/mcp`.

## 2. Local CLI & Stdio MCP (Zero-Trust E2EE Pairing)

For local coding agents (Claude Code, Codex, Cursor, Antigravity, CI scripts):

- Install via `npx -y notibuddy@latest` or `brew install yourbit-network/tap/notibuddy`.
- Run `notibuddy pair` (or `nb pair`) to generate a local P-256/HPKE keypair and pair via the iPhone app's Share Setup bundle.
- Requests to the relay are authenticated with per-request P-256 sender signatures and sealed end-to-end with HPKE (RFC 9180).

## References

- Setup guide: `https://notibuddy.app/setup.md`
- MCP Server Card: `https://notibuddy.app/.well-known/mcp/server-card.json`
- Agent Discovery Manifest (ARD): `https://notibuddy.app/.well-known/ard.json`
