Skip to main content
Relay MCP is an OAuth 2.1 protected resource that fails closed. Every request must include a valid Authorization: Bearer <token> header. Tokens sent in query parameters or tool arguments are ignored and the request is rejected. The server never falls back to an unauthenticated state.

Discovery endpoint

Before acquiring a token, query the protected resource metadata to find the authorization server and supported scopes.
Response

Token requirements

  • Header only: pass the token in the Authorization header. Never in a query parameter or tool argument.
  • Audience-bound: tokens must be minted for the MCP endpoint via the RFC 8707 resource parameter. Tokens created for a different audience are rejected.
  • Scope and organization bound: the token carries a fixed set of scopes and a fixed list of organizations. A tool call succeeds only when the token includes the required scope and the requested organizationId is in the token’s organization list.

Scopes and tool access

tools/list returns only the tools unlocked by the scopes on your token. Request only the scopes your agent needs.

Authentication failure

When the token is missing, malformed, or unverifiable, the server returns HTTP 401 Unauthorized with this header:
This is a transport-level failure, not a tool error. Your client must re-authorize before retrying the request.

Authentication flow

1

Discover the authorization server

Call GET /.well-known/oauth-protected-resource/mcp to read the authorization_servers array and scopes_supported.
2

Request a token

Complete OAuth against the advertised authorization server. Include the resource parameter set to the MCP endpoint so the token is audience-bound.
3

Send the token on every request

Include Authorization: Bearer <token> in the header of every POST /mcp call. The server is stateless and does not remember prior authorization.
4

Handle 401 by re-authorizing

If you receive a 401, re-read the discovery document and repeat the OAuth flow. Do not retry the same request with the same token.

Transport

Learn how Relay MCP uses a single POST endpoint with JSON responses.

Errors

Understand how auth failures and rate limits surface at the transport level.