Skip to Content
How-to guidesMCP connectionsConnect ChatGPT to MCP with OAuth

Connect ChatGPT to MCP with OAuth

Audience: Integrator.

Use this procedure to connect a public MCP backend to ChatGPT.

Prerequisites

  • Make the MCP endpoint and OAuth discovery documents reachable over public HTTPS.
  • Use a normal backend user account.
  • Use ChatGPT developer mode with custom MCP connector access.
  • Test backend OAuth in Insomnia before you configure ChatGPT.
  • Use the actual public API host and path prefix throughout the setup.

OpenAI documentation dated May 11, 2026 describes remote MCP connectors in ChatGPT developer mode. It recommends OAuth and dynamic client registration for custom remote MCP servers. See:

Create the connector

  1. In ChatGPT developer mode, create a custom MCP connector.
  2. Enter the remote MCP endpoint URL, for example:
https://api.example.com/v1/ai/mcp

The OAuth metadata documents must also be reachable from ChatGPT:

https://api.example.com/.well-known/oauth-authorization-server https://api.example.com/.well-known/oauth-protected-resource

The OAuth reference describes the automatic connection sequence. This backend supports public clients only with token_endpoint_auth_method=none. Do not configure a client secret.

Register the ChatGPT callback URL

In ChatGPT’s Benutzerdefinierter OAuth-Client setup, copy the exact Callback-URL from the connector form.

Register this callback URL with the backend. Save the returned client_id:

curl -X POST https://api.example.com/v1/oauth/register \ -H 'Content-Type: application/json' \ -d '{ "client_name": "ChatGPT MCP", "redirect_uris": ["PASTE_THE_CALLBACK_URL_FROM_CHATGPT_HERE"], "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], "scope": "mcp", "token_endpoint_auth_method": "none" }'

Important:

  • The callback URL must match exactly, including letter casing.
  • If ChatGPT shows a different callback URL later, register that new value again and use the newly returned client_id.
  • Leave client_secret empty for this backend.

Fill in the ChatGPT fields

For a backend at https://api.example.com, enter these values in the ChatGPT connector form:

ChatGPT fieldValue
RegistrierungsmethodeBenutzerdefinierter OAuth-Client
Callback-URLcopy the value shown by ChatGPT and register it with /v1/oauth/register
OAuth-Client-IDthe client_id returned by the registration call above
OAuth-Client-Geheimnis (optional)leave empty
Authentifizierungsmethode für Token-Endpunktnone
Standard-Scopesmcp
Basis-Scopesleave empty
Auth-URLhttps://api.example.com/v1/oauth/authorize
Token-URLhttps://api.example.com/v1/oauth/token
Registrierungs-URLhttps://api.example.com/v1/oauth/register
Basis-URL des Autorisierungsservershttps://api.example.com
Ressourcehttps://api.example.com/v1/ai/mcp
OIDC aktiviertdisabled
OIDC-Konfigurations-URLleave empty
OIDC UserInfo-Endpunktleave empty
Unterstützte OIDC-Scopesleave empty

If your deployment uses another public API host or path prefix, replace https://api.example.com in each value above.

PKCE compatibility

ChatGPT’s connector interface does not expose PKCE settings. The backend permits specific OpenAI callback hosts to authorize without PKCE. Other OAuth clients require PKCE. Use the OAuth reference for the complete rule.

Troubleshooting ChatGPT setup

  • If ChatGPT cannot connect, make sure the MCP endpoint is public and uses HTTPS.
  • Confirm the resource the backend expects is the same MCP endpoint URL.
  • Confirm the backend discovery documents are reachable without authentication.
  • Confirm the client_id belongs to the exact callback URL currently shown in ChatGPT.
  • If the OAuth browser flow opens but fails, inspect the authorize request and callback redirect URI.
  • If ChatGPT reconnects repeatedly, examine backend token and refresh-token handling. Make sure you recreated the connector after authentication changes.

Verify the connection

  1. Complete backend login and consent from the ChatGPT connector.
  2. Make sure the connector can make MCP requests with the issued access token.
  3. If the connection fails, confirm the endpoint works with a bearer token in Insomnia.
  4. Use the troubleshooting steps above to separate backend errors from connector configuration errors.
Last updated on