Skip to main content
A server’s verifier decides who a request runs as. Every tool call then runs as that principal: its grants admit the call, its roles clear labels, and guards judge its acts with as set to it.

OAuth access tokens

By default a server accepts a JWT access token issued for its exact endpoint URL, and a signed-in Bijection application session. Set up the token issuer in the deployment’s sign-in.ts and configure the provider to issue an access token whose aud includes the MCP endpoint. Declare the required scopes with oauth: { scopes: ["notes:read"] }. If your issuer assigns broader scopes, declare the implication with scopeHierarchy: { "notes:admin": ["notes:read"] } in oauth. For an endpoint at /mcp, clients discover the resource and its configured issuers at /.well-known/oauth-protected-resource/mcp. A missing or invalid credential receives a 401 Bearer challenge that points to this document. A valid credential missing a required scope receives 403 with error="insufficient_scope". Request the exact resource audience when signing in. The server offers no offline scope and keeps access tokens out of handlers and tool arguments.

Sessions and shared bearers

verify comes from @bijectionhq/bijection.
verifier: verifier.session() accepts only a Bijection application session. Add oauth beside it to accept either credential. verifier.bearer(secret) accepts one shared ingress bearer, which an operator sets with bijection secret set <path> --route "POST <route path>" (a mounted app’s route also takes --app <path>). A shared bearer identifies the route, not a person: the request runs with the route as its principal, so give such a server only tools that anyone holding the bearer may call.

Who may call which tool

The verifier admits a principal; it grants nothing. What the principal may do is what its grants allow, and guards refuse within that:
  • allow on a tool’s function names the roles that may enter it from a client. The server reaches internal functions too, so a tool is exposed to every principal the server admits.
  • A guard on act.enter(fn) judges each call, with as.kind ("person", "agent", "service", "installation"), verified contacts in as.email and as.phone, and role, the role of the grant the call runs through.
  • A call without the authority answers Disallowed; one a guard refuses answers Forbidden with the guard’s path.

Origins

Requests that carry an Origin must come from the deployment site or an origin listed in mcp({ origins: [...] }). List exact origins, including the scheme and any port, without a path.