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:
- Building MCP servers for ChatGPT and API integrations
- Developer mode, apps and full MCP connectors in ChatGPT [beta]
Create the connector
- In ChatGPT developer mode, create a custom MCP connector.
- Enter the remote MCP endpoint URL, for example:
https://api.example.com/v1/ai/mcpThe 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-resourceThe 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_secretempty 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 field | Value |
|---|---|
| Registrierungsmethode | Benutzerdefinierter OAuth-Client |
| Callback-URL | copy the value shown by ChatGPT and register it with /v1/oauth/register |
| OAuth-Client-ID | the client_id returned by the registration call above |
| OAuth-Client-Geheimnis (optional) | leave empty |
| Authentifizierungsmethode für Token-Endpunkt | none |
| Standard-Scopes | mcp |
| Basis-Scopes | leave empty |
| Auth-URL | https://api.example.com/v1/oauth/authorize |
| Token-URL | https://api.example.com/v1/oauth/token |
| Registrierungs-URL | https://api.example.com/v1/oauth/register |
| Basis-URL des Autorisierungsservers | https://api.example.com |
| Ressource | https://api.example.com/v1/ai/mcp |
| OIDC aktiviert | disabled |
| OIDC-Konfigurations-URL | leave empty |
| OIDC UserInfo-Endpunkt | leave empty |
| Unterstützte OIDC-Scopes | leave 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
resourcethe backend expects is the same MCP endpoint URL. - Confirm the backend discovery documents are reachable without authentication.
- Confirm the
client_idbelongs 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
- Complete backend login and consent from the ChatGPT connector.
- Make sure the connector can make MCP requests with the issued access token.
- If the connection fails, confirm the endpoint works with a bearer token in Insomnia.
- Use the troubleshooting steps above to separate backend errors from connector configuration errors.