Start the OAuth authorization of an MCP server of one's own
Starts the authorization code flow with PKCE of one of the caller's oauth2 servers (ADR 0046, slice 4c). Needs tools.user.add, a deployment that keeps credentials and has an address for the OAuth callback (userToolServers.oauth.callbackUrl, or server.publicUrl). There is no request body (one is not read).
The credential broker discovers the server's authorization server (the protected resource metadata of RFC 9728, then the authorization server's metadata of RFC 8414; it refuses one that does not offer PKCE S256), registers a client if it must, and keeps the PKCE verifier; the orchestrator keeps only state → (the caller, this server, until expiresAt). The answer is where to send the person: the caller's client opens authorizeUrl in a browser (the web in the page, the desktop in the system browser, mobile in an in-app tab) and shows issuer, the authorization server a stranger's MCP server chose, next to the button. The state is inside authorizeUrl and is not given beside it. When the person has consented, the authorization server sends the browser to the orchestrator's callback (finishUserToolAuthorization), which needs no session; the client then learns the new status from listToolServers or listUserToolServers (ready when it worked).
A server that is already connected can be authorized again (another account, a wider scope): the grant is replaced when the callback finishes, and nothing is written before. A later call for the same server ends the earlier one: its state is no longer one. Nothing of the definition is written by this operation.
Rate limited per person: ten calls a minute, in each process of the orchestrator (a burst of ten, then one more every six seconds). Every call counts, a refused one too. 429 with Retry-After.
What the answer and the authorization server see. authorizeUrl is a link anybody can hand to somebody else, and the callback finds the person by the state and not by a session, so whoever opens it and consents completes the flow of the person who began it. The consent page is built from the client (userToolServers.oauth.clientName, the orchestrator's own name), the redirect URI, the resource (the server's URL) and the scopes; nothing that names the owner, the server's id or the name the owner gave it is sent to an authorization server or in this answer. Deployments should keep tools.user.add to roles they trust, list the authorization servers and MCP hosts they trust in userToolServers.egress.allow, and show issuer before the person consents (ADR 0046, "Amended 2026-10-15, slice 4c review", departure 125).
A name that does not resolve to a public address. A URL whose name resolves to a private or reserved address is the 422 egress_refused; one that does not resolve is the 503 authorization_unavailable. The two answers tell the person who typed the URL a little about what a name resolves to; that is accepted, given the rate limit above.
Cache-Control: no-store: authorizeUrl carries the state and the PKCE challenge.
Authorizations
A JWT signed by the configured issuer (RS256, RS384, ES256 or EdDSA), with the configured audience. Read when auth.mode is jwt or jwt_or_proxy_header. A missing or refused token gets 401 with WWW-Authenticate: Bearer; an issuer whose keys cannot be fetched gets 503.
A JWT as bearerToken, bound to the key of the client (cnf.jkt, RFC 7638), sent as Authorization: DPoP <token> with one DPoP header holding a proof signed by that key (RFC 9449, ADR 0054). Read only when auth.dpop is configured. A bad proof gets 401 with WWW-Authenticate: DPoP error="invalid_dpop_proof", algs="ES256 EdDSA", a bad or unbound token error="invalid_token".
Set by oauth2-proxy after OIDC login; requests without it get 401. Read when auth.mode is proxy_header (the default) or jwt_or_proxy_header without a bearer token.
Request Body
Responses
Where to send the person