Skip to content

OAuth and scopes

How an agent gets access to a business with OAuth 2.1, what each scope allows, and how access is revoked.

Access to the Restoman MCP is OAuth 2.1 with PKCE. The authorization server is https://api.restoman.com.ar; the protected resource, https://api.restoman.com.ar/mcp. The same flow, step by step and written for agents, is at https://api.restoman.com.ar/auth.md.

Discover

  1. A call to the MCP with no token answers 401 with WWW-Authenticate: Bearer resource_metadata="https://api.restoman.com.ar/.well-known/oauth-protected-resource/mcp".
  2. That document (RFC 9728) names the authorization server and the scopes.
  3. The server's metadata is at https://api.restoman.com.ar/.well-known/oauth-authorization-server (RFC 8414) and at /.well-known/openid-configuration.

Register

There are no keys to request. The agent registers itself, in one of two ways:

  • Client ID Metadata Document, MCP's preferred way: the client_id is an https URL that serves the client's metadata.
  • Dynamic registration (RFC 7591) at https://api.restoman.com.ar/api/auth/oauth2/register, unauthenticated. Send "token_endpoint_auth_method": "none" to register as a public client; otherwise registration gives you a secret (client_secret_basic), which you keep and send.

A client that asks for no scopes gets the read scopes and offline_access.

Authorize

  1. Send the person to https://api.restoman.com.ar/api/auth/oauth2/authorize with response_type=code, your client_id and redirect_uri, a code_challenge using S256, the scopes in scope, and resource=https://api.restoman.com.ar/mcp.
  2. The person signs in to Restoman's dashboard with the code they get by email.
  3. If they belong to more than one business, they pick the one you connect to. Each grant is for one business.
  4. They tick what you may do: what only reads comes ticked; what changes things doesn't.
  5. They come back to your redirect_uri with a code, which you exchange for tokens at https://api.restoman.com.ar/api/auth/oauth2/token.

Ask for offline_access to get a refresh token. Access tokens are JWTs for that resource and that business and last 10 minutes; the refresh token changes on every use. DPoP-bound tokens are accepted.

Restoman's support team, while viewing the dashboard as someone else, can't connect agents on their behalf.

Scopes

Scope What it allows At consent
menu:read Read the menus and what's sold out ticked
orders:read Read the takeout orders ticked
reports:read Read the sales ticked
menu:availability Mark dishes sold out, or back on unticked
orders:pause Pause and resume takeout orders unticked
menu:translate Translate the menu's text into another language unticked

Each scope is a ceiling over what the person's role already lets them do at that business: with reports:read, a waiter still can't see sales, and the tool says why.

Revoke

  • The person disconnects you in Assistants, in the dashboard: the grant ends at once and the next call answers 401.
  • You can revoke a refresh token at https://api.restoman.com.ar/api/auth/oauth2/revoke (RFC 7009). Access tokens are JWTs: they aren't revoked one by one (that endpoint answers unsupported_token_type) and stop working when they expire, within 10 minutes.

All guides