Rate limits & errors

packages/mcp/src/handler.ts enforces per-grant limits in a 60-second window:

KindLimit
Read tools60 calls / minute
Write tools20 calls / minute

Exceeded calls return rate-limited errors, are audited, and include no data.

Common errors

SituationBehavior
Missing or revoked token401, no tools executed
Scope insufficientTool omitted from list or rejected on call
Cross-brand idnot_found
Audit write failureCall rejected before execution
PHI scope requestMint 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.