Rate limits & errors
packages/mcp/src/handler.ts enforces per-grant limits in a 60-second window:
| Kind | Limit |
|---|---|
| Read tools | 60 calls / minute |
| Write tools | 20 calls / minute |
Exceeded calls return rate-limited errors, are audited, and include no data.
Common errors
| Situation | Behavior |
|---|---|
| Missing or revoked token | 401, no tools executed |
| Scope insufficient | Tool omitted from list or rejected on call |
| Cross-brand id | not_found |
| Audit write failure | Call rejected before execution |
| PHI scope request | Mint rejected at creation |
JSON-RPC
POST body uses JSON-RPC 2.0 with method values such as tools/list and tools/call. Errors include a machine code and message without PHI.
OAuth dynamic client registration metadata is published at /api/mcp/oauth-metadata; registration alone does not grant brand access.