MR Labs

OAuth Reference

Full OAuth 2.1 endpoint reference for MR Labs MCP. Used by ChatGPT and other MCP clients for automatic authentication.

Endpoints

EndpointURLMethod
MCP Endpoint/mcpPOST
Authorization/oauth/authorize (frontend)GET
Token Exchange/api/v1/oauth/tokenPOST
Client Registration/api/v1/oauth/registerPOST
Auth Server Metadata/.well-known/oauth-authorization-serverGET
Protected Resource/.well-known/oauth-protected-resourceGET

Authorization Server Metadata

The /.well-known/oauth-authorization-server endpoint returns:

FieldValue
issuerYour ISSUER_URL
authorization_endpoint{APP_URL}/oauth/authorize
token_endpoint{ISSUER_URL}/api/v1/oauth/token
registration_endpoint{ISSUER_URL}/api/v1/oauth/register
response_types_supportedcode
grant_types_supportedauthorization_code
token_endpoint_auth_methods_supportedclient_secret_post, none
code_challenge_methods_supportedS256
scopes_supportedmcp

Client Registration (RFC 7591)

Clients register themselves automatically via POST /api/v1/oauth/register. The request body includes:

FieldTypeDescription
client_namestringDisplay name of the client
redirect_urisstring[]Allowed callback URLs
grant_typesstring[]authorization_code
response_typesstring[]code
token_endpoint_auth_methodstringnone (public client) or client_secret_post
scopestringRequested scopes, e.g. mcp

The response returns client_id, client_secret (if applicable), and the registered metadata.

Authorization Flow

  1. Client redirects user to /oauth/authorize?response_type=code&client_id=...&redirect_uri=...&code_challenge=...&code_challenge_method=S256&scope=mcp&state=...
  2. User logs in and approves the connection on the MR Labs authorization page
  3. MR Labs redirects back to redirect_uri with code and state
  4. Client exchanges the code at POST /api/v1/oauth/token with grant_type=authorization_code, code, code_verifier, and redirect_uri
  5. Token endpoint returns a personal access token that the client uses as Authorization: Bearer ... on all MCP requests

PKCE

All authorization requests must use PKCE (Proof Key for Code Exchange) with the S256 method. The client generates a code_verifier and derives code_challenge = BASE64URL(SHA256(code_verifier)).

Public Clients

Clients with token_endpoint_auth_method: "none" do not send a client secret during token exchange. This is the default for ChatGPT and other browser-based MCP clients.