# UnitClock MCP — agents on the same workflows as your managers

UnitClock exposes a **Model Context Protocol** server so Cursor, Claude Desktop, or your orchestrator can run daily sweeps, read compliance clocks, draft notices (dry-run), attach proofs, and export audit trails — with the same confirm gates as the web app.

**Endpoint:** `https://unitclock.com/api/mcp`  
Unauthenticated requests return **401** (by design) with `WWW-Authenticate: Bearer resource_metadata="…/.well-known/oauth-protected-resource/api/mcp"`.

## Transport (Streamable HTTP)

- **POST** — JSON-RPC 2.0 (`initialize`, `tools/list`, `tools/call`). Send `Accept: application/json, text/event-stream`.
- **POST** — Legacy `{ "tool": "…", "arguments": { … } }` envelope still supported.
- **GET** — Tool name catalog with a valid bearer. No long-lived GET SSE stream (405 when `Accept: text/event-stream`).
- **Discovery** — `/.well-known/oauth-protected-resource/api/mcp`, server card at `/.well-known/mcp.json` and `/.well-known/mcp/server-card.json` (same JSON). Unauthenticated `POST /api/mcp` is **401** `unauthorized` and includes `demo_key_url`. It does not return `mcp_disabled`.

## Auth model

API keys are primary. OAuth is a machine path, not a fake authorization server.

- **Org API keys** — `Authorization: Bearer uc_live_…`, stored as a SHA-256 hash. Create one in the app (Agents). Missing or invalid key → **401** `unauthorized`.
- **Sandbox key** — `uc_demo_public_sandbox`, or `GET /api/mcp/demo-key`. Scoped to seeded Austin (`fac_austin`) and Oakland (`fac_oakland`). Reads and dry-run writes. Confirm does not persist. Vendor confirms return **402**.
- **OAuth 2.1 client_credentials** — `POST /api/oauth/token` with client id `unitclock_demo` and the sandbox secret (or a linked org client). Access tokens look like `uc_tok_…` and expire in one hour. Metadata does **not** advertise authorization code, PKCE, or dynamic registration.
- **Ops break-glass** — optional `UNITCLOCK_MCP_TOKEN`. Unset does not turn the endpoint off.
- **Default:** `dry_run` on mutating tools until `confirm: true` on a paid key. Retries send `Idempotency-Key`.
- **Live notice sends** need a paid org, `live_sends_enabled`, and `confirm: true`. Email stays fail-closed until Resend is configured.

## Tool surface (29 tools)

Groups: daily sweep & due lists; notices (generate/send/delivered); contacts & proofs; overlock; auction ads, reschedule, stop-sale, payments; SCRA; exports; FMS sync & state packs; ask→build intake.

Discover names with `GET /api/mcp` and a valid key. Full schemas: product `MCP.md` in repo / sales packet.

## Install (Cursor)

```json
{
  "mcpServers": {
    "unitclock": {
      "url": "https://unitclock.com/api/mcp",
      "headers": {
        "Authorization": "Bearer uc_demo_public_sandbox"
      }
    }
  }
}
```

## Install (Claude Desktop)

Add to `claude_desktop_config.json` under `mcpServers` (same URL and headers as above).

## Honest limits

- **Not legal advice.** Every law-citing response includes `disclaimer` and `pack_version`.
- Demo / fixture packs — not attested counsel templates.
- **No guaranteed compliance** or “SCRA safe” marketing.
- **No Square/Stripe checkout changes** via MCP; billing stays in the app.
- Contact logs are **non-statutory diligence** only.

**Pricing:** [MCP & agent consumption](https://unitclock.com/pricing/mcp) · **HTML:** [unitclock.com/mcp](https://unitclock.com/mcp)
