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
- A call to the MCP with no token answers
401withWWW-Authenticate: Bearer resource_metadata="https://api.restoman.com.ar/.well-known/oauth-protected-resource/mcp". - That document (RFC 9728) names the authorization server and the scopes.
- 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_idis 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
- Send the person to
https://api.restoman.com.ar/api/auth/oauth2/authorizewithresponse_type=code, yourclient_idandredirect_uri, acode_challengeusingS256, the scopes inscope, andresource=https://api.restoman.com.ar/mcp. - The person signs in to Restoman's dashboard with the code they get by email.
- If they belong to more than one business, they pick the one you connect to. Each grant is for one business.
- They tick what you may do: what only reads comes ticked; what changes things doesn't.
- They come back to your
redirect_uriwith acode, which you exchange for tokens athttps://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 answersunsupported_token_type) and stop working when they expire, within 10 minutes.