Sign in

The OAuth token endpoint for hosted MCP clients

Changed on

The OAuth 2.1 token endpoint for a hosted MCP client (RFC 6749, with resource indicators as RFC 8707 has them), named by the authorization server metadata at /.well-known/oauth-authorization-server. Form-encoded. grant_type= authorization_code trades a sign-in code issued with resource=https://www.onlyworlds.com/mcp (send the same resource here) for an access token that lives an hour and works through the MCP server only, and a refresh token; grant_type=refresh_token trades the refresh token for a new pair, and the old one stops working. The grant reads (world:read), and writes too where the person chose Read and write on the sign-in page (world:read world:write); the answer's scope says which. The person revokes it, or stops its writes, on their account page. No credential is needed here: public clients, no secret.

post/api/v2/auth/oauth/token

Request

  • Base URL
    https://www.onlyworlds.com
  • Auth
    none required

Request body application/x-www-form-urlencoded

object required
grant_type, 'authorization_code' | 'refresh_token' required
code, string

authorization_code: the code the return address carried, issued with resource naming the MCP server. Single use, valid for 60 seconds.

code_verifier, string

authorization_code: the PKCE verifier whose S256 hash was the request's code_challenge.

redirect_uri, string

authorization_code: as in the sign-in request, byte for byte.

refresh_token, string

refresh_token: the ow_f_ refresh token of the last answer.

client_id, string required

As in the sign-in request.

resource, string

https://www.onlyworlds.com/mcp, required with authorization_code (RFC 8707); optional with refresh_token, and then the same.

scope, string

Optional: world:read, or world:read world:write (in either order). It neither widens nor narrows the grant, which is what the person chose on the sign-in page: the answer's scope says what was granted.

Response

A token pair for the MCP server, in RFC 6749's shape (not this API's envelope). Cache-Control: no-store.

object required
access_token, string required

An ow_a_ token for the MCP server at https://www.onlyworlds.com/mcp only (every other route refuses it, 401 wrong_audience). Send it there as Authorization: Bearer.

token_type, 'Bearer' required
expires_in, integer required

Seconds the access token lives: 3600.

refresh_token, string required

An ow_f_ refresh token: single use, 30 days. A refresh grant answers a new pair and the old one stops working; a used refresh token sent again ends the whole grant.

scope, 'world:read' | 'world:read world:write' required

What the access token may do now: world:read, or world:read world:write while the person's choice of Read and write on the sign-in page stands.

Changes

    • info

      added the optional property error/limit to the response with the status

    • info

      added the optional property error/limit to the response with the status

    • breaking

      the scope response property const value world:read was removed for the status

    2 more changes in this revision