Skip to content

OAuth 2.1 Flow

You do not need this page to use Hype Doc from an AI tool. It is for people building an MCP client or debugging a failed sign-in.

The /mcp endpoint accepts OAuth access tokens only. API tokens work on the REST API but are rejected here.

An unauthenticated request to https://app.myhypedoc.com/mcp returns 401 with a pointer to the resource metadata:

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://app.myhypedoc.com/.well-known/oauth-protected-resource"

Two documents describe the rest:

GET https://app.myhypedoc.com/.well-known/oauth-protected-resource
GET https://app.myhypedoc.com/.well-known/oauth-authorization-server

The authorization server document lists these endpoints:

PurposePath
Client registrationPOST /oauth/register
AuthorizationGET /oauth/authorize
TokenPOST /oauth/token
RevocationPOST /oauth/revoke
Grant typesauthorization_code, refresh_token
PKCERequired, S256 only
Client authenticationNone. All clients are public.
Scopesread, write. If a client sends none, it gets both.
Access token lifetime1 hour
Redirect URIshttps anywhere, or http on localhost, 127.0.0.1, or ::1. No fragments.

Clients register themselves. There is no client secret and no manual setup.

  1. The client registers with POST /oauth/register, sending redirect_uris and an optional client_name. The response contains a client_id.
  2. The client sends the user to /oauth/authorize with the client_id, redirect_uri, response_type=code, a code_challenge, and code_challenge_method=S256.
  3. The user signs in to Hype Doc if needed and approves the request on the consent page.
  4. Hype Doc redirects back to the client with a code.
  5. The client calls POST /oauth/token with the code and the PKCE verifier. It receives an access token and a refresh token.
  6. The client sends Authorization: Bearer <access token> on every /mcp request.
  7. When the access token expires, the client calls /oauth/token with grant_type=refresh_token. Each refresh returns a new refresh token.
ScopeAllows
readlist_wins, list_spaces, list_tags
writelog_win, create_space, export_wins

Without write, a call to a write tool returns 403 with Insufficient scope. The 'write' scope is required for this tool. Initialization and tools/list still work.

/mcp is a stateless Streamable HTTP endpoint. Each request stands alone, responses are plain JSON, and there is no session to resume. Request bodies are limited to 1 MB.

Users can disconnect an app at any time from Connected apps in the web app’s Settings. Clients can also call POST /oauth/revoke.

EndpointLimit
POST /oauth/register5 per minute per IP
GET /oauth/authorize30 per minute per IP
POST /oauth/token20 per minute per IP
/mcp60 per minute per token

See Rate Limits for the 429 response format.