MCP clients find and use these endpoints on their own from the metadata. This page is for checking what they do, and for building your own consent page. All of them answer 404 until the app turns MCP sign-in on. Token, register, revoke and introspect answers carry Cache-Control: no-store.
Metadata#
/.well-known/oauth-authorization-server/v1/oauth/:app_idNone/v1/oauth/:app_id/.well-known/oauth-authorization-serverNoneRFC 8414 metadata, by path insertion (what MCP clients try first) and appended.
{ "issuer": "https://api.scute.io/v1/oauth/app_xxx", "authorization_endpoint": "https://api.scute.io/v1/oauth/app_xxx/authorize", "token_endpoint": "https://api.scute.io/v1/oauth/app_xxx/token", "registration_endpoint": "https://api.scute.io/v1/oauth/app_xxx/register", "revocation_endpoint": "https://api.scute.io/v1/oauth/app_xxx/revoke", "introspection_endpoint": "https://api.scute.io/v1/oauth/app_xxx/introspect", "jwks_uri": "https://api.scute.io/v1/auth/app_xxx/jwks", "response_types_supported": ["code"], "response_modes_supported": ["query"], "grant_types_supported": ["authorization_code", "refresh_token"], "code_challenge_methods_supported": ["S256"], "token_endpoint_auth_methods_supported": ["none"], "revocation_endpoint_auth_methods_supported": ["none"], "scopes_supported": ["tools:read", "tools:write"], "authorization_response_iss_parameter_supported": true, "client_id_metadata_document_supported": true}registration_endpoint is missing when dynamic registration is off. scopes_supported is every scope of the app's enabled MCP servers.
Authorize#
/v1/oauth/:app_id/authorizeNone| Query | Required | Meaning |
|---|---|---|
| response_type | yes | code |
| client_id | yes | A known client, or an https URL to a client metadata document |
| redirect_uri | yes | One of the client's redirect URIs |
| code_challenge | yes | PKCE challenge, 43 base64url characters |
| code_challenge_method | yes | S256 |
| resource | yes | One of the app's MCP server URLs |
| scope | no | Space-separated scopes of that server. Default: all of them. |
| state | no | Returned as is |
Until the client and redirect URI check out, errors are shown as JSON and never sent to the redirect URI. After that, errors go back to the redirect URI with error, error_description, state and iss: unsupported_response_type, invalid_request (no PKCE S256), invalid_target (bad resource), invalid_scope.
On success Scute redirects the browser to the consent page with ?request=oar_.... The request handle is valid for 10 minutes.
The consent page#
The hosted page is on the app's hosted site at /oauth/authorize. It signs the person in with the app's methods and shows what the client asks for. The API never renders HTML.
/v1/oauth/:app_id/requests/:handleNone, or session tokenWhat the page shows: client (name, client_id, kind, host, client_uri, logo_uri), resource (url, name), scopes and expires_at. With the person's session token in X-Authorization, it adds already_granted: whether they already agreed to all of this. An expired or used handle is 404 with request_not_found.
/v1/oauth/:app_id/requests/:handle/decisionSession tokenNeeds the signed-in person's session token in X-Authorization. Answers { "redirect_to": "..." }: the client's redirect URI with code, state and iss, or with error=access_denied. A handle can be decided once.
Your own consent page#
Set login_url in the settings to use your own page. Scute sends the browser to login_url?request=oar_.... Sign the person in with Scute as usual, read the request with GET /requests/:handle, show it, post the decision with their session token, and send the browser to redirect_to.
Token#
/v1/oauth/:app_id/tokenNone (public client)Authorization code#
| Field | Meaning |
|---|---|
| grant_type | authorization_code |
| client_id | The client |
| code | From the redirect. Valid for 60 seconds, once. |
| redirect_uri | The same as on authorize |
| code_verifier | The PKCE verifier, 43 to 128 characters |
| resource | Optional. Must match the grant's resource. |
{ "access_token": "eyJ...", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "ort_...", "scope": "tools:read tools:write"}The access token's claims: iss, sub (the app user id), aud (the MCP server URL), client_id, scope, iat, exp, jti, and scute with grant and app. Verify it with the jwks_uri from the metadata, and check typ is at+jwt.
Using a code twice revokes the grant.
Refresh#
| Field | Meaning |
|---|---|
| grant_type | refresh_token |
| client_id | The client |
| refresh_token | The latest refresh token |
| scope | Optional. Equal to or narrower than before; never wider. |
| resource | Optional. Must match the grant's resource. |
Each refresh returns a new refresh token and spends the old one. Presenting a spent refresh token again revokes the grant.
Token errors#
| error | When |
|---|---|
| invalid_client | Unknown or disabled client (401) |
| invalid_grant | Unknown, used or expired code or refresh token, wrong redirect_uri, PKCE failed, grant revoked, or the person is banned or suspended |
| invalid_target | resource does not match the grant |
| invalid_scope | A refresh asked for wider scope |
| unsupported_grant_type | Any other grant type |
Token exchange for a task#
The MCP gateway trades a person's access token for an agent task token (RFC 8693), so every tool call runs through the agent and person and task check. This grant needs the app key.
| Field | Value |
|---|---|
| grant_type | urn:ietf:params:oauth:grant-type:token-exchange |
| subject_token | The person's access token |
| subject_token_type | urn:ietf:params:oauth:token-type:access_token |
| resource | Optional. Must equal the token's aud. |
curl -X POST https://api.scute.io/v1/oauth/$SCUTE_APP_ID/token \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -d grant_type=urn:ietf:params:oauth:grant-type:token-exchange \ -d subject_token=$ACCESS_TOKEN \ -d subject_token_type=urn:ietf:params:oauth:token-type:access_token{ "access_token": "sct_...", "issued_token_type": "urn:scute:params:oauth:token-type:task", "token_type": "N_A", "expires_in": 3412, "scope": "tools:read tools:write", "task_id": "TASK_ID", "agent": "mcp-assistant", "scope_actions": { "tools:read": ["invoice:read"], "tools:write": ["invoice:refund"] }}The task acts for the token's person, as the client's linked agent (or the app's default_agent), and expires with the access token (at least 60 seconds). When the MCP server maps scopes to permissions, the task's actions are the granted scopes' permissions. Errors: invalid_client without the app key, invalid_request when no agent is linked, invalid_grant when the token is not live or the agent is suspended.
Register a client#
/v1/oauth/:app_id/registerNoneRFC 7591, public clients only. Takes client_name, redirect_uris, client_uri, logo_uri, grant_types (authorization_code and refresh_token only) and token_endpoint_auth_method (none only). Answers 201 with client_id (dcr_...) and the registered metadata. 404 when dynamic registration is off. Errors: invalid_client_metadata, invalid_redirect_uri.
Revoke#
/v1/oauth/:app_id/revokeNoneRFC 7009. Takes client_id and token (a refresh token). Revokes the whole grant when the token belongs to that client. Always answers 200.
Introspect#
/v1/oauth/:app_id/introspectApp keyRFC 7662. Takes token: an access token or a refresh token. An active token answers active: true with token_type, sub, client_id, scope, aud and exp (access tokens also iss, iat, jti). Anything else answers { "active": false }.