The OAuth token endpoint for hosted MCP clients
Changed onThe 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.
Request
- Base URLhttps://www.onlyworlds.com
- Authnone required
Request body application/x-www-form-urlencoded
authorization_code: the code the return address carried, issued with resource naming the MCP server. Single use, valid for 60 seconds.
authorization_code: the PKCE verifier whose S256 hash was the request's code_challenge.
authorization_code: as in the sign-in request, byte for byte.
refresh_token: the ow_f_ refresh token of the last answer.
As in the sign-in request.
https://www.onlyworlds.com/mcp, required with authorization_code (RFC 8707); optional with refresh_token, and then the same.
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.
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.
Seconds the access token lives: 3600.
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.
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/limitto the response with the status - info
added the optional property
error/limitto the response with the status
- info
- breaking
the
scoperesponse property const valueworld:readwas removed for the status
2 more changes in this revision
- breaking