Codex (OpenAI)
The Codex desktop app and Codex CLI support remote MCP servers, including OAuth. For detailed configuration instructions, visit the official documentation.
This guide covers the local Codex desktop app and CLI - not ChatGPT web or hosted Codex tasks. Examples use PowerShell on Windows; app labels and CLI options can vary by Codex release.
Connecting with OAuth lets Codex sign you in through your organization's identity provider, using MCP OAuth with Dynamic Client Registration (DCR). For the full client and admin setup, follow the OAuth Setup guide.
Connect with OAuth (Recommended)
Codex uses Timbr's Streamable HTTP endpoint:
https://<your-timbr-host>/timbr/api/mcp
Use the exact same URL in the configuration and at sign-in, including any trailing slash - Codex derives its OAuth callback from the server URL. Don't use the legacy /sse endpoint for this flow.
Signing into Codex with a ChatGPT account does not authenticate you to Timbr. The OAuth flow opens your organization's identity provider so you sign in as your own Timbr user.
Codex Desktop App
Install or update the Codex desktop app and sign into Codex.
Open Settings (
Ctrl+,on Windows,Cmd+,on macOS) and search for the MCPs with the label Plugins underneath. Then click on the Add dropdown menu and choose the Add MCP server option.
Give a name to the custom MCP server, for example
timbrChange the Type to
Streamable HTTPEnter the URL of your MCP server which should be in the following pattern:
https://<your-timbr-host>/timbr/api/mcpClick on the Save button.

Click Authenticate on the
timbrserver and sign in through your organization's identity provider.Start a new conversation and confirm Timbr's tools are available.
Your Timbr admin must register the Codex redirect URI (for example http://127.0.0.1:57535/callback/<id>) with your identity provider, and enable DCR on the server. Follow the OAuth Setup guide for more information.
Codex CLI
Check that your CLI supports forcing DCR:
codex --version
codex mcp login --helpThe login help should list
--oauth-client-registration. If it doesn't, update Codex. Older versions may still use DCR automatically throughcodex mcp login timbr.Add Timbr (skip this if you already added it through the app or
config.toml):codex mcp add timbr --url https://<your-timbr-host>/timbr/api/mcp
codex mcp listDon't pass
--oauth-client-id, an API key, or a bearer token. Add the[mcp_servers.timbr.oauth]callback_portsetting from the desktop app steps above toconfig.toml.Authenticate with DCR:
codex mcp login timbr --oauth-client-registration dcrYour browser opens your organization's sign-in page. Complete login, MFA, and consent, and wait for Codex to report that login is complete before closing the terminal.
Start Codex and run
/mcpto inspect the active servers, then verify with a real tool call:Use the Timbr MCP server's list_ontologies tool to list the ontologies available to my account. Do not create or modify anything.
A listed server is not proof of authentication - confirm the tool call completes without an authentication error. An empty list is valid if your account has no ontology grants.
The desktop app and CLI share MCP configuration on the same host, but not necessarily credentials. Authenticate in the same environment where the app runs - a login done inside WSL, a container, or another user account is not reused by a Windows app.
Codex registers itself as an OAuth client through Timbr's /timbr/api/oauth/register endpoint, then uses the authorization-code flow with PKCE. If your identity provider (e.g. Azure AD) doesn't natively support DCR, your IT admin can enable it on the server by setting MCP_OAUTH_DCR_ENABLED=true together with MCP_OAUTH_CLIENT_ID and MCP_OAUTH_CLIENT_SECRET. See the OAuth Setup guide for the complete provider configuration.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
--oauth-client-registration is unrecognized | Older Codex CLI | Update Codex, or use codex mcp login timbr and let it select DCR automatically |
| No registration request reaches Timbr | An explicit OAuth client ID is configured, or a previous registration is being reused | Remove oauth.client_id from the configuration; sign out of timbr (see codex mcp --help) and log in again |
AADSTS50011 / redirect mismatch | The Codex callback isn't registered on the identity provider app, or the port changed between sign-ins | Pin callback_port and ask your admin to register the exact callback - see the OAuth Setup guide |
| Browser callback cannot connect | The login process stopped, or sign-in ran in a different host (WSL, SSH) | Keep the login running and sign in from the same host as Codex |
Login works, but tools return 401 or 403 | Expired token, missing Timbr user, or no ontology grants | Re-authenticate; ask your admin to confirm your Timbr user and access, and remove conflicting static auth settings |
| Browser says "Authentication complete", but Authenticate reappears | Codex received a Microsoft Graph token instead of a Timbr token (Timbr API Service before version 5.8.1) | Upgrade Timbr API Service to version 5.8.1 or later, or force the Timbr scope |
| CLI works but the app doesn't | Different host, user, CODEX_HOME, server URL, or credential store | Align them and restart the app |
Force the Timbr Scope
Codex requests the scopes listed in Timbr's authorization-server metadata. Before Timbr API Service version 5.8.1, that list held only OpenID scopes (openid profile email offline_access), so Azure AD answered with a Microsoft Graph token that Timbr can't validate: sign-in appears to succeed, then every tool call fails authentication. Timbr Service API version 5.8.1 and later list the resource scope first, so this setting isn't needed there.
To force the scope, add scopes to the server's table, using your server's MCP_OAUTH_SCOPES value followed by offline_access (which gets Codex a refresh token):
[mcp_servers.timbr]
url = "https://<your-timbr-host>/timbr/api/mcp"
scopes = ["api://<resource-app-id>/.default", "offline_access"]
[mcp_servers.timbr.oauth]
callback_port = 57535
Restart the app and click Authenticate - the new sign-in replaces the stored Graph token. The setting stays harmless after upgrading Timbr. With the CLI, codex mcp login timbr --scopes "api://<resource-app-id>/.default,offline_access" does the same for a single login.