You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Authenticating with oauth protected MCP servers fails in WebIDEs #24058
CLIIssues related to the Codex CLIauthIssues related to authentication and accountsbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) servers
Currently Codex can advertise a non-localhost MCP OAuth callback URL via mcp_oauth_callback_url, which is needed when running Codex in a remote environment such as codeserver/WebIDE.
However, WebIDE/code-server exposes forwarded ports through a path prefix, while Codex receives the forwarded callback without that prefix. For example, Codex may advertise:
Codex currently requires the received callback path to exactly match the advertised path, so this callback is rejected.
This means it is impossible to authenticate oauth protected mcp servers when running codex on WebIDE/codeserver
What steps can reproduce the bug?
Setup a codeserver/WebIDE environment.
Define config for an OAuth protected MCP server in config.toml
Define callback url and port for MCP server in config.toml
try to authenticate with codex mcp login [NAME]
new tab opens in browser window
but OH NO: "This site can’t be reached"
What is the expected behavior?
New tab in browser should indicate successful authentication and when going back to codeserver tab, the MCP server authentication process in the terminal should be completed.
Additional information
This issue can be easily solved by adding a new mcp_oauth_callback_path_mode parameter with the following options.
exact preserves the current behavior. suffix allows the received callback path to be a suffix of the advertised path, so WebIDE/code-server proxy callbacks work while still requiring the callback id to match.
I would like to open a PR. Is that possible @etraut-openai ?
CLIIssues related to the Codex CLIauthIssues related to authentication and accountsbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) servers
Activity
github-actions commentedon May 22, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action