MCP OAuth contract
Audience: Developer and Integrator.
This reference defines the backend’s OAuth endpoints and client constraints.
The protected MCP resource is /v1/ai/mcp.
The backend handles browser OAuth under /v1/oauth/*. Discovery documents use /.well-known/*.
Backend OAuth summary
The current backend implementation supports:
- Authorization Code flow
- Refresh tokens
- Dynamic client registration
- Public clients only with
token_endpoint_auth_method=none - Scope
mcp - Resource indicator
https://YOUR_API_HOST/v1/ai/mcp
Discovery endpoints:
GET /.well-known/oauth-authorization-server
GET /.well-known/oauth-protected-resourceOAuth endpoints:
GET /v1/oauth/authorize
POST /v1/oauth/authorize
POST /v1/oauth/token
POST /v1/oauth/registerClient requirements
OAuth clients use the MCP endpoint URL as the exact resource indicator.
Registered redirect URLs must match the callback URL exactly, including letter case.
The backend supports public clients only with token_endpoint_auth_method=none. No client secret is required.
How ChatGPT connects
The expected flow is:
- In ChatGPT developer mode, create a new custom MCP connector.
- Enter the remote MCP endpoint URL.
- ChatGPT reads the MCP and OAuth metadata.
- ChatGPT registers itself dynamically as an OAuth client.
- ChatGPT opens the backend login and consent flow.
- The user signs in and approves access.
- ChatGPT stores the issued access token and uses it for MCP requests.
This backend supports only public clients with token_endpoint_auth_method=none. You do not need to configure a client secret.
ChatGPT-specific compatibility note
ChatGPT’s MCP OAuth connector interface does not expose PKCE settings.
The backend permits an exception for specific OpenAI callback hosts. These permitted hosts can complete authorization without PKCE. Other OAuth clients require PKCE.
This means:
- Configure Insomnia and other direct OAuth clients to use PKCE.
- ChatGPT can connect through OAuth when it omits PKCE.
Use Insomnia setup or ChatGPT setup for client-specific field values and validation. For a client configured with a user token, use user-token setup.